AutoPanel reload() only purge 'beforeremove' (fix)

This fixes a regression introduced in 2fe7e94e995 where resizing of
child containers was broken after reloading the tab. See in-code
comments for details.

Also fix possible uninitialized warning in util func