events: fix the race condition while avoiding a deadlock
Add a conditional variable to wait for an event to finish running within evsched to avoid race condition (memory deallocating) and a potential deadlock (with evsched). This solution continues in enabling access to the evsched heap during event callback execution to avoid possible soft lockup.