apiserver: avoid data race in shutdown
apiserver: avoid data race in shutdown

Fixes LP 1465115

Ensure that the listening socket is always the first thing that is closed
when Server.Kill or Stop is issued. This avoids a race where requests in
fly may increase the waitgroup count while the final wg.Wait() defer is in
effect.

wwitzel3/juju,bogdanteleaga/juju,tsakas/juju,voidspace/juju,Altoros/juju-cloudsigma,gabriel-samfira/juju,wwitzel3/juju,marcmolla/juju,perrito666/juju,axw/juju,dimitern/juju,tsakas/juju,cloud-green/juju,anastasiamac/juju,waigani/juju,kat-co/juju,fwereade/juju,waigani/juju,frankban/juju,howbazaar/juju,kat-co/juju,anastasiamac/juju,fwereade/juju,mjs/juju,mhilton/juju,gabriel-samfira/juju,macgreagoir/juju,mjs/juju,reedobrien/juju,perrito666/juju,alesstimec/juju,macgreagoir/juju,axw/juju,marcmolla/juju,mikemccracken/juju,dimitern/juju,alesstimec/juju,bz2/juju,tsakas/juju,davecheney/juju,reedobrien/juju,makyo/juju,anastasiamac/juju,reedobrien/juju,cloud-green/juju,mhilton/juju-juju,macgreagoir/juju,alesstimec/juju,thomnico/juju,frankban/juju,makyo/juju,marcmolla/juju,mikemccracken/juju,cloud-green/juju,dooferlad/juju,kat-co/juju,mjs/juju,mhilton/juju,howbazaar/juju,davecheney/juju,mikemccracken/juju,perrito666/juju,mjs/juju,ericsnowcurrently/juju,axw/juju,reedobrien/juju,axw/juju,perrito666/juju,dooferlad/juju,dooferlad/juju,bz2/juju,bz2/juju,howbazaar/juju,dooferlad/juju,kat-co/juju,macgreagoir/juju,thomnico/juju,voidspace/juju,mhilton/juju,mjs/juju,marcmolla/juju,anastasiamac/juju,fwereade/juju,bz2/juju,frankban/juju,makyo/juju,ericsnowcurrently/juju,wwitzel3/juju,mhilton/juju-juju,alesstimec/juju,macgreagoir/juju,frankban/juju,bac/juju,cloud-green/juju,thomnico/juju,ericsnowcurrently/juju,mjs/juju,mikemccracken/juju,howbazaar/juju,dooferlad/juju,Altoros/juju-cloudsigma,anastasiamac/juju,mhilton/juju-juju,bz2/juju,perrito666/juju,howbazaar/juju,dimitern/juju,Altoros/juju-cloudsigma,gabriel-samfira/juju,davecheney/juju,tsakas/juju,bac/juju,mhilton/juju-juju,AdamIsrael/juju,bogdanteleaga/juju,AdamIsrael/juju,waigani/juju,mjs/juju,gabriel-samfira/juju,bac/juju,bogdanteleaga/juju,wwitzel3/juju,makyo/juju,fwereade/juju,reedobrien/juju,bogdanteleaga/juju,frankban/juju,ericsnowcurrently/juju,voidspace/juju,Altoros/juju-cloudsigma,mhilton/juju,axw/juju,dimitern/juju,waigani/juju,kat-co/juju,thomnico/juju,ericsnowcurrently/juju,davecheney/juju,gabriel-samfira/juju,voidspace/juju,alesstimec/juju,AdamIsrael/juju,mikemccracken/juju,bac/juju,AdamIsrael/juju,marcmolla/juju,bac/juju,dimitern/juju