Use pqCoreUtilities to find main window.
Originally, pqCMBPostProcessingModeBehavior was iterating through the top level widgets and trying dynamic casts on the result. This would occasionally result in a segfault during the dynamic cast. The pqCoreUtilities method findMainWindow() does a very similar thing, but it uses qobject_cast and performs some additional checks before casting. It appears to be a more robust way to find the main window.