Fixes for G_MESSAGES_DEBUG

 * Respect G_MESSAGES_DEBUG when set
 * Make GKR_DEBUG work again even with glib versions that use
   G_MESSAGES_DEBUG