In abstract Chosen, make sure reference to jQuery-only variable is
set before acting on it.

Fixes #1165