Guard waitgroup access with a mutex to prevent race.

Running my application with 'go run -race ...' always reports a race condition at exit if any requests have been served.

I can't say for certain that it was a problem, but this fixes it.

It's better to have no spurious error messages, to avoid the habit of ignoring them.