Fix a race condition problem

I've fixed #3857.

And I am sorry. I didn't know my commit was notified to upstream automatically. 
I shouldn't have done force-push.
All those errors have already been fixed on master hence travis doesn't report them. If you rebase your branch onto upstream master you won't get them either. Only the ones your patch introduces.