Devices for counting or registering the number of articles handled, or the number of packages produced by the machine