MAIDUGURI, Nigeria — A shadowy Islamist insurgency that has haunted northern Nigeria — surviving repeated, bloody efforts to eliminate it — appears to be branching out and collaborating with Al Qaeda’s affiliates, alarming Western officials and analysts who had previously viewed the militants here as a largely isolated, if deadly, menace.