The electronic and magnetic properties of KPbM2(PO4)3 (M = Cr and Fe) by first-principles calculations