Improve extension code injection logic (delay + deduplication)

Two changes:
 * When loading a new document in a tab, we get two onUpdated
   notifications: one with the "loading" status, and one with th
   "complete" status. We don't need to try to inject our code
   in the "loading" status, so let's just drop that notification.
 * When injecting our code to a page, wait a sec before actually
   running our script. This is necessary because there are cases
   (expecially with PDF.js) when the page is rewriting it's code
   like crazy, so any script tags we add will be deleted/overwritten.
   So we wait. Also, there are cases when we get several injectation
   attempts in succession. (For PDF, there are 4 onUpdate notifications:
   2 "loading" and 2 "complete" types.) So we keep track of the tabs
   where we already have a pending injection, and don't try to do it
   again.

Fixes #893.