make log reopens more robust in multithreaded apps