Adiabatic cooling of bosons in lattices to magnetically ordered quantum states