Add more debugging information.
Change socket state after sending FIN.