(CE-87) Fix memory leak in jquery.makeCollapsible

Fixing a memory leak in jquery.makeCollapsible that causes browser
memory to increase on every Ajax refresh of the recent changes. Ajax
refreshing of the RCs is the most popular user JS customisation.

This backports a fix from MediaWiki core for the same issue.
See https://git.wikimedia.org/commitdiff/mediawiki%2Fcore/bf61991
for the commit this is backporting.

@federico-lox As this is a change to MW core assigning to you. :)