RUBY-16065: sometimes :io option is absent so let's default to $stdout
reviewed by Valentin Fondaratov
(cherry picked from commit 0887209)