Quantum magnetism of spinor bosons in optical lattices with synthetic non-Abelian gauge fields