fixed bug #5894: File locking and unlocking not clean

https://bugs.oxid-esales.com/view.php?id=5894