Fix: remove the lock before close (it would be removed on exit, anyway)
Fix permissions