The free energy of N = 2 supersymmetric AdS4 solutions of M-theory