Fixe stderr redirection test

This fixes a stderr redirection test on fast machines. The write pipe was getting closed before the redirection thread had a chance to copy its contents into it. This affects multiple versions of ruby. We were seeing it on MRI 2.1.0 & JRuby 1.7.9.

This PR was broken out from #617