PDF: Where possible, allow output to stdout

PDF output to stdout was broken a while back.

It doesn't seem to be possible for stdout under windows, as I can't find a way to re-open stdout for update.

Support PDF output to stdout in other environments (where the POSIX freopen (NULL) semantics are implemented.)

stdout still must be seekable.