#141637 follow up patch by merlinofchaos: proper placement of menu_rebuild() to not run twice on the same request