implement preexec_fn for environments

preexec_fn is called before called execv