close stdin so that stdout receives input

For me quantize_to would never return, being stuck in stdout.gets(nil). Sending EOF to stdin solves this issue.