Use tied file handle for STDIN

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.
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.
Merge pull request #3 from waldiTM/master

Use tied file handle for STDIN