Fixed bug #10730: Release record locks when logging out (Thanks to Oliver Schröder)