jquery.makeCollapsible: Only trigger custom events once per collapsible

The callback to $.fn.animate()-family functions is fired once per animated
element, not once per call.

Use $.when instead, which behaves the way we need here.

Discovered when writing tests committed in I33b067a7.

Change-Id: I9d61a34374d42609d8d80206f4a4b315f76a8d8d
Merge "jquery.makeCollapsible: Only trigger custom events once per collapsible"