Fix connection leak

When the data is no longer good after an accept, not closing the
connection leads to leaks.