git: Close output stream while advertising.

While advertising, close output stream before sending it as byte array,
as GitRpc does.