qt: unload the wayland module before its dependencies are gone
This is cherry-picked from !7277. I open this so that it is not lost.
The discussion there (!7277 (5137924c, comment 485531)) is a more generic concern regardless of here, which is about destroyMainInterface() should not be called before the video window is gone (as that destroys the interface window which may close/destroy the display connection). Here, I just early unload the module.
We must do this because if any reason reinitialization is wanted after destroyMainInterface() is called, we need to start over with a fresh wayland module. So ensuring destroyMainInterface() is called after video window is gone and this change can/should coexist.