Magnetic properties of layered rare-earth oxy-carbonates Ln2O2CO3 (Ln=Nd, Sm, and Dy)