'Unlock a file by removing the .lock file, and close the handle.'

def unlock_and_close(self):

    if self._locked:
        lock_filename = self._posix_lockfile(self._filename)
        os.unlink(lock_filename)
        os.close(self._lock_fd)
        self._locked = False
        self._lock_fd = None
    if self._fh:
        self._fh.close()
