[3.4.x] Memory optimisations
This fixes a major memory leak with the average color extension used for the audio player and a smaller one for the image gradient extension (which was moved to a file of its own).
Additionally, the audio player's sliders are only setup once now instead of on every change of metadata and the playback state is only stored if playback is actually active.
Backport of !1012 (merged)