Panel: Make sure active state is applied and removed to buttons in header too.

Fix for #5583.

Tested on iOS6.1, Android 4.1, Linux/Chromium, Linux/Firefox, Win7/Chrome, Win7/Firefox. All unit tests pass.