Place WRITE locks around DELETE/INSERT-based updates

See #19.

Modified _update_data() to apply a table WRITE lock around the DELETE and INSERT used when updating multiple-value fields.

Added Database::lock_table() and Database::unlock_table(), with implementations for MySQL