client/server: fix failing on connect error