The high-pressure phase transitions of silicon and gallium nitride: A comparative study of Hartree-Fock and density functional calculations