Make JSONWriter threadsafe by using print instead of puts

It turns out that in Ruby, #print is atomic and #puts is not. Just change the line to use #print and JSONWriter is no longer problematic under threaded execution.