Fix for #186 - Manual garbage collection for gx_wmslegend

Keep a reference of the legend container and simply destroy it before creating new ones.