Safer event listener removal