Kinetics at the collapse transition of homopolymers and random copolymers