agent: reload event scripts properly, fixes #221