Make sure downloaded files have a ".pdf" extension

Partially addresses #2407. I couldn't find a way to get the HTTP headers without sending an `XMLHttpRequest` and reading the headers sent back, but there are plenty of reasons to NOT do that.

This patch simply ensures there is a `.pdf` extension on the file (e.g if you are at a URL that ends in .php because a PHP script generated the PDF, this adds a .pdf to the file, so it is .php.pdf)