builtin/apply: move 'max_change' and 'max_len' into 'struct apply_state'