[backend] Automatically unlock projects when the backend dies.
[backend] Fix locking on dead connections.