info: Fix deadlock in gst_ring_buffer_logger_log

gst_ring_buffer_logger_log calls several functions while formatting
the message which may in turn log a message while we already hold
the mutex. Do all formatting first before acquiring the mutex to
avoid this and reduce the time we hold the mutex.
22 jobs for backport-mr-211-into-1.16-fix_ring_logger in 63 minutes and 10 seconds (queued for 33 seconds)
Status Job ID Name Coverage
  Preparation
passed #489195
gst indent

00:00:28

passed #489194
manifest

00:00:44

 
  Build
passed #489201
build cerbero android universal

00:14:34

passed #489202
build cerbero cross win32

00:09:36

passed #489203
build cerbero cross win64

00:07:23

passed #489200
build cerbero fedora x86_64

00:05:29

passed #489205
gst-ios-12.2
build cerbero ios universal

00:36:35

passed #489204
gst-macos-10.14
build cerbero macos x86_64

00:08:26

passed #489196
build fedora x86_64

00:05:25

passed #489890
build nodebug fedora x86_64

00:05:45

passed #489198
build static fedora x86_64

00:12:04

passed #489199
build static nodebug fedora x86_64

00:11:22

failed #489197
build nodebug fedora x86_64

00:03:52

 
  Test
passed #489206
check fedora

00:03:57

passed #489207
integration testsuites fedora

00:12:06

passed #489212
valgrind bad

00:09:58

passed #489209
valgrind base

00:06:42

passed #489208
valgrind core

00:12:28

passed #489213
valgrind ges

00:07:52

passed #489210
valgrind good

00:11:40

passed #489211
valgrind ugly

00:03:17

 
  Integrate
passed #489214
android universal examples

00:07:11