ajax_modal: Combine trigger and preserve selectors

...in one event handler registration, so if something matches both
trigger and preserve selectors, it still only gets one event handler
call, not two. Fixes #772

Needs to be backported to a 5.0.2 release as a bugfix.