client: fix possible parser races