Gating heat transport by manipulating convection in a magnetic nanofluid