This should fix problems where the lock was not released after the app
was closed.