Bug 1066340 - Handle null/undefined alternativeURI.host. r=Gijs

Without this, we fail in [1] and friends when we pass the host value to
asyncResolve.

[1] browser/base/content/test/general/browser_keywordSearch.js
Bug 1066340 - Use an AutoEntryScript in nsFrameMessageManager::ReceiveMessage. r=smaug