builtin/apply: move 'diffstat' global into 'struct apply_state'