ofEvents: lock when accessing collections to prevent crashes on threaded events