coreserver: Avoid calling socket methods in exception handlers

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