Wait for animation frame before displaying stuff

When pdf.js is hidden (e.g. behind display:none div), the following exception appears:

```
[14:00:34.756] TypeError: parent is null @ resource://pdf.js/web/viewer.js:61
```

See http://people.mozilla.com/~ydelendik/presentations/ecma5.html as example.

The PR waits until the pdf.js will be visible to display pages. <del>Might be good when lots of PDFs is opened in different tabs.</del>