Bug 990020 - [B2G][SMS] A MMS that has not been downloaded yet will display a "Missing SIM card" message after changing the SIM to a different valid one. r=julien

There are two commits here:
* Base fix;
* Refactoring of Messaging API error code.
One of the reasons that I load it lazily is that ```dialog.js``` is loaded earlier than ```message_manager.js``` and ```thread_ui.js```.