Don't throw an exception on empty string io on JRuby. Fix #883.