Actually return error_code::LOCKED

So despite handling the locked error condition everywhere, I wasn't
actually parsing the SQLite error code correctly and therefor was
never actually seeing it.

This has been fixed.