Fix close() on socket