Only handle scroll events when PDFView.pdfDocument is defined (issue 4642)

Attempted workaround to fix #4642. This should work, and it's a very easy solution, but I'm not completely convinced that this is the best way to handle the issue.

__Edit:__ The reason for my apprehension about it, is that the patch adds code that is unnecessary most of the time to a function that is called *a lot*.

@dferer Does this fix the issue?