Ensure exceptions thrown from GLib main loop sources are properly propagated
On some architectures (e.g. arm) throwing a C++ exception from a handler called by the GLibMainLoop (i.e. across the GLib shared library boundary) doesn't work properly. We work around that by catching and re-emitting the exception from a safe point manually.
Approved by PS Jenkins bot, Kevin DuBois, Alan Griffiths, Alberto Aguirre, Andreas Pokorny.