Fix for plugin causing a freeze if something went wrong during database
handling
We no longer need 'locked', as we use synchronized.