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.
> I extracted only piece of duplicated code in https://github.com/hypothesis/h/commit/7f23bb1b15aa0c5e0b1be1f8144c9bfdc0d4d1a6.

Retrying: I extracted **the** only piece of duplicated code.