[Helpers] Read a file again if the size is 0.

Some tests such as testChildProcessManager::test_createWithEnv()
sometimes fails due to empty of file contents. Although the clear
reason is unknown, we try to read repeatedly in order to avoid
the failure.