Add implementation for with-file-modes.

* lisp/pdf-util.el: Optionally define the macro with-file-modes, if it
  is not available.