Fix statement leak

As you suggested:
Fix a possible leak of a SQLite statement object in case of an error in
the updateRecord() method. This also preserves the correct error message.

Thanks for the notice.