packer/rpc: get rid of data races in tests