Panel: Make sure active state is applied to and removed from 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.