Do not free the event base lock until we are done removing all the events. Spotted by Joachim Bauch; fixes bug 2795402. svn:r1302