FIX #2398: file locking wasn't thread-safe