English resident doctors agree on pay deal