[FIX] run_env_cmd: Add validation to get_env_to_export