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.
Merge pull request #1924 from ironcladlou/dev/v2carts/gearscript

Set sync on STDOUT/STDERR in gear script