The density of electrons / holes depends on BOTH the effective mass of the electron / holes (which, as you correctly realize, affects the density of states) AND the fermi level.
If the fermi level moves towards the conduction band, you get more electrons and fewer holes; if the fermi level moves towards the valence band, you get fewer electrons and more holes.
Therefore, there is some possible location (in the band gap) of the fermi level where the number of electrons equals the number of holes. For a big piece of undoped semiconductor, that is exactly where you'll find the fermi level.
If the electron and hole effective masses are different, then the intrinsic (# holes = # electrons) fermi-level depends on temperature. Therefore, as you change the temperature of the semiconductor, the fermi level will shift up or down a bit. It will not be exactly halfway between the conduction and valence bands; it will have a temperature-dependent offset.
There is no law that says that the fermi level has to be independent of temperature.