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.
My mistake, I will fix them.
I didn't any care about CS of test cases.
So I got lots of build errors :(
I will fix them.

By the way, in my windows, PHPCS reports many errors about test cases.
Several errors are not my fault.

<blockquote><pre>
C:\var\www\cakephp.dev\httpdocs\lib\Cake\Test\Case\Model>phpcs --standard=CakePHP Datasource\DboSourceTest.php

FILE: ...ephp.dev\httpdocs\lib\Cake\Test\Case\Model\Datasource\DboSourceTest.php
--------------------------------------------------------------------------------
FOUND 18 ERROR(S) AFFECTING 16 LINE(S)
--------------------------------------------------------------------------------
   36 | ERROR | Missing function doc comment
   58 | ERROR | Missing function doc comment
   62 | ERROR | Missing function doc comment
   66 | ERROR | Missing function doc comment
   70 | ERROR | Missing function doc comment
   74 | ERROR | Missing function doc comment
   91 | ERROR | Missing function doc comment
   95 | ERROR | Missing function doc comment
   99 | ERROR | Missing function doc comment
  103 | ERROR | Missing function doc comment
  545 | ERROR | There must be exactly one blank line before the tags in
      |       | function comment
 1145 | ERROR | Missing comment for param "$db" at position 1
 1212 | ERROR | Doc comment for "$join" missing
 1212 | ERROR | Doc comment for "$expected" missing
 1228 | ERROR | Doc comment for "$schema" missing
 1250 | ERROR | Doc comment for "$join" missing
 1250 | ERROR | Doc comment for "$expected" missing
 1419 | ERROR | @return tag is empty in function comment
--------------------------------------------------------------------------------

Time: 2.03 seconds, Memory: 14.50Mb
</pre></blockquote>

 Why travis doesn't report these errors?
Do you know the reason?