lightirc: cleanup and fix crash