Clean up after fork more exhaustively

I was having some problems running the libgit2 test suite while in gdb on my Mac apparently related to not handling interrupted attempts to wait on forks.  This makes sure we really wait to get the subprocesses cleaned up.