Fix #2257 - Improve custom select event robustness

Custom form selects use .prev() to find the underlying select field.
This breaks with plugins like jQuery Validate that insert content between
the underlying select element and the custom markup element. This patch
uses prevAll('select').first() to select the closest previous sibling
element to improve the robustness of this functionality.