fix a seg fault on kqueue when bad connection