expose waitgroup.Wait so shutdown handlers can wait on the server

We are running the server in a goroutine and need to `Wait` in a shutdown handler that is called in another goroutine, so this patch exposes the `Wait` method of the waitgroup. It also removes the implicit wait in `Serve` which I think should be done explicitly in the callee and not as a side-effect, but you may want to ignore this hunk for backwards compatibility.