coreserver: Fix crash on multiple connects

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