Quasi-degenerate perturbation theory with general multiconfiguration self-consistent field reference functions