http2: don't return from RoundTrip until request body is closed
http2: don't return from RoundTrip until request body is closed

Moving the Request.Body.Close call out from the ClientConn mutex
results in some cases where RoundTrip returns while the Close is
still in progress. This should be legal (RoundTrip explicitly allows
for this), but net/http relies on Close never being called after
RoundTrip returns.

Add additional synchronization to ensure Close calls complete
before RoundTrip returns.

Fixes golang/go#55896

Change-Id: Ie3d4773966745e83987d219927929cb56ec1a7ad
Reviewed-on: https://go-review.googlesource.com/c/net/+/435535
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
Reviewed-by: Dmitri Shuralyov <d181b7fea0ec87c86ba5a890ab716db52498e3ba@google.com>
Run-TryBot: Damien Neil <7e091e9a80da888fcd7836fd3c6b7b85f4677c12@google.com>
TryBot-Result: Gopher Robot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>

golang/net