popover: Ensure there is a child before focusing it

Fixes a warning in empty popovers being shown.