Magnetosheath plasma precipitation in the polar cusp and its control by the interplanetary magnetic field