Fixed TypeError when destroying Select2

This fixes #2587.