Fix other potential race conditions similar to ref #1597 in RPC tests. Signed-off-by: Daira Hopwood <daira@jacaranda.org>