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