net: make some tests less flaky

Fixes issue 4969

R=golang-dev, minux.ma
CC=golang-dev
https://codereview.appspot.com/7456049