coreserver/client: Check for connection on shutdown

Signed-off-by: Michael Buesch <m@bues.ch>