swap order of redirects

- you need to dup2 before redirecting
Merge pull request #212 from opscode/lcg/java-stdout-bug

swap order of redirects