Set sync on STDOUT/STDERR in gear script

The gear script is assumed to be interactive. Enable sync on the STDOUT/STDERR
objects to ensure output is line-buffered.