core: Terminate goroutine used for logging errors (#2398)
core: Terminate goroutine used for logging errors (#2398)

Terminate the goroutine used for logging errors by using a
WaitGroup (stopWg) to track termination of servers.
Fixes #2358.
joshix/caddy,joshix/caddy,joshix/caddy