Fixed flakey tests

Assuming return value of time() and microtime() will increment by 1 when called every time, some issues will appear. (microtime(true) - $time will always greater than 1.) Also, $config is possible to be null when calling set_config.
No, it will not. It will still loop for 1 second. Adding a flag here can prevent the problem from this situation: When the return value of the second call of microtime() is greater than $time+1, it will skip the while loop, which will cause the problem.