Bug 877164, return early if nsDocument::Init fails, r=smaug