Segmentation fault caused by STDOUT manipulation in ruby 2.0.0p451