Avoid error if event handler's teardown didn't happen

Signed-off-by: Atul Pratap Singh <atulpratapsingh05@gmail.com>