Fix close_connection for ACCEPTED state