Fix race condition in JSONFileLogger.Log Upstream-commit: b2d00e312b23b9942a1db2ccf6b56288ac3bc57d Component: engine