Massive star cluster formation: III. Early mass segregation during cluster assembly