Issue745: Add last errormessage to database locked error

Issue745: Add last error message to database locked error