Critical thickness for ferromagnetism in LaAlO3/SrTiO3 heterostructures