Added some assertions to some Desktop methods to check that the message manager is locked.