Fixes #404: soft-close the ios to prevent failure from being exceptional.

Works around an odd interaction on JRuby where an already-closed IO (broken pipe)
creates an exceptional scenario.

HT @crimsonknave for isolating the bug that was causing JRuby consumers' tests
to flap. See also #404.