MFC r349998:
Fix socket state handling when freeing an SCTP endpoint.
This issue was found by runing syzkaller.