Add test for tied file handles
Use tied file handle for STDERR

Some PSGI server don't provide a file handle for input and errors.
They need to be tied to a file handle to be properly used.