Read stdout to end of stream

Git (version 1.8.3-preview20130601) exits with error code when stdout is
closed without reading to the end.
Merge pull request #400 from kgybels/read_stdout

Read stdout to end of stream