(Re)Fix locking around deleteFile (fixes #64)