Removes all locks and ensures their content is written to disk.

def remove_all_locks(self):
        """Removes all locks and ensures their content is written to disk."""
        locks = list(self._locks.items())
        locks.sort(key=lambda l: l[1].get_last_access())
        for l in locks:
            self._remove_lock(l[0])