Romo, Cowboys avoid upset, nip Vikings 27-23 in final minute