mysql_thread_init and mysql_thread_end

All calls to acquire (internal to MySQLDataProvider) to obtain an exclusive lock on the connection (among other related tasks) now call mysql_thread_init before the lock is acquired and mysql_thread_end after it is released.

This seems to clear up an issue which was causing the server to briefly hang on shutdown, and may be a viable way to workaround issues (see here: https://bugzilla.redhat.com/show_bug.cgi?id=846602) related to libmysqlclient's multi-threading model on POSIX.
MySQLDataProvider Bugfix

Fixed a bug which was causing recipients of chat messages to be incorrectly formatted in the database.