Delete MainWindow's molecule after setting a new one, not before.

Otherwise extensions that need to e.g. disconnect signals/slots from the
old molecule crash.

Change-Id: I752ac004d0d97c998fb2dc79bfc9f6bfdb6edabc
Merge topic 'safe-delete-molecule' into master

f070ceae Delete MainWindow's molecule after setting a new one, not before.