fix connection state release

dict:find return wasn't correctly matched which prevented any release from ets
when the process was exiting unexpecteadly. fix #77