getting rid of possible race conditions during log-dir creation