core: fix memory leak when removing script files
irc: fix memory leak in CTCP answer