NaviMaster: Learning a Unified Policy for GUI and Embodied Navigation Tasks