Cleanup locks after releasing

This adds a little more logic to the SQLDB locks, allowing them to cleanup after themselves upon releasing.
They will grab another lock before deleting to ensure that a chance is given to someone waiting for the lock to grab it. Deletion is not retried since it's assumed that the next owner of the lock will delete it later.
Not really, this method accepts a lock type, which could include `NOWAIT`. On the other hand I can definitely do this on the blocking public methods that wrap this one.