gstdebug: fix occasional deadlocks on windows when outputting debug logging
When outputting debug logs on Windows, some sections are protected with a non-recursive lock. Turns out though that gst_debug_message_get() might indirectly, via our printf format extensions, call code which in turn would try to log something when it can't handle something. If that happens we end up in gst_debug_log_default() again recursively and try to again take the lock that's already taken, thus deadlocking. Format the debug message string outside of the critical section instead to avoid this. https://bugzilla.gnome.org/show_bug.cgi?id=784382