GMutex (linux): detect and report some errors
GMutex (linux): detect and report some errors

Detect the following two errors:

 - attempting to unlock a mutex that is not locked

 - attempting to clear a mutex that was not initialised or was
   initialised but is still locked

Both of these are fatal errors.  We avoid using g_error() here because
doing so would involve calls back into the GMutex code, and if things
are going off the rails then we want to avoid that.

https://bugzilla.gnome.org/show_bug.cgi?id=731986

ieei/glib,endlessm/glib,cention-sany/glib,endlessm/glib,cention-sany/glib,johne53/MB3Glib,mzabaluev/glib,johne53/MB3Glib,ieei/glib,tamaskenez/glib,gale320/glib,MathieuDuponchelle/glib,Distrotech/glib,tamaskenez/glib,gale320/glib,ieei/glib,mzabaluev/glib,tchakabam/glib,tamaskenez/glib,gale320/glib,tchakabam/glib,endlessm/glib,lukasz-skalski/glib,endlessm/glib,johne53/MB3Glib,cention-sany/glib,MathieuDuponchelle/glib,tamaskenez/glib,Distrotech/glib,krichter722/glib,tchakabam/glib,cention-sany/glib,tchakabam/glib,mzabaluev/glib,Distrotech/glib,krichter722/glib,cention-sany/glib,mzabaluev/glib,krichter722/glib,ieei/glib,Distrotech/glib,lukasz-skalski/glib,krichter722/glib,MathieuDuponchelle/glib,MathieuDuponchelle/glib,Distrotech/glib,lukasz-skalski/glib,tamaskenez/glib,johne53/MB3Glib,gale320/glib,lukasz-skalski/glib,krichter722/glib,johne53/MB3Glib,gale320/glib,MathieuDuponchelle/glib,johne53/MB3Glib,lukasz-skalski/glib,tchakabam/glib,ieei/glib,mzabaluev/glib,endlessm/glib