Critical frequency for vortex nucleation in Bose-Fermi mixtures in optical lattices