Chamfering the end edges of gear teeth