Magnetic and magnetocaloric properties of the ternary cadmium based intermetallic compounds of Gd2Cu2Cd and Er2Cu2Cd