Nontrivial temperature dependence of magnetic anisotropy in multiferroic Ba2MnGe2O7