ELM control at the L → H transition by means of pellet pacing in the ASDEX Upgrade and JET all-metal-wall tokamaks