Added a backwards compatible fallback to the changes made in PR #173

The constants STDOUT and STDERR are not available if calling out to Phing from a script running under apache. This PR adds a check for their existence, and falls back to calling fopen.