Make sure STDIN is defined before attempting to read it (it is not available when the PHP script itself is read via STDIN, which is how PHPUnit runs isolated tests), refs #1437