Add "#define GLIB_DISABLE_DEPRECATION_WARNINGS" to eliminate a warning message
python: Hold a reference to plugin instead of dereferencing hook to get to it.

hook might have been free'd by the callback via hexchat.unhook().