Handle various deployment problems

Detect and handle these problems:
 * User is trying to deploy the extension over a local file, but forgot to grant file permissions
 * When trying to deploy on an HTML document over the file:/// protocol
 * When trying to deploy on a PDF file, withouth PDF.js

Fixes #1650 and #1663.
> This method is getting long and theres plenty of duplication, lets extract it out into several smaller methods.

I extracted only piece of duplicated code in https://github.com/hypothesis/h/commit/7f23bb1b15aa0c5e0b1be1f8144c9bfdc0d4d1a6.

Yes, it's still long. We can break it up to smaller pieces, but since there is no duplication or reuse, I don't see any benefits.