net/http: improve test reliability

Fixes issue 4852

R=golang-dev, adg
CC=golang-dev
https://codereview.appspot.com/7374045