Improve checking if sidebar exists and fix notice about missing key '_multiwidget' which can cause 'Headers already sent warning'