Fix test for git >= 1.8.2

The behavior of --depth changed in 1.8.2. Previously, when --depth=n was specified,
the most recent n + 1 commits were present in the clone. In 1.8.2 and newer, the most
recent n commits are.

See https://raw.githubusercontent.com/gitster/git/master/Documentation/RelNotes/1.8.2.txt
Fix race condition in testing

If the git timeout test is run on a machine which can run many threads,
the TCP server finishes the call to `handle` and resets the connection
before the timeout has occurred, and the test fails.