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