perf(jQuery): only trigger $destroy if a handler exists

This is the exact same performance improvement that jQuery UI recently did: https://github.com/jquery/jquery-ui/commit/f7429edfe96d322cdec850f7207efba8125767a6