try to solve problem with jruby causing Errno::EBADF on close_write of popen opened with r+