Prevent assertation failures with Qt 5 by not unlocking mutexes that have not been previously locked.
Convert a direct call chain to QApplication::syncX() to a Qt queued call to prevent cross-thread usage of X11, ultimately causing XIO errors and crashes [#327367, #332977].