fixed bug #5894: File locking and unlocking not clean