Reimplement prepend_envvar_at with cleanpath