core/execute: only clean the environment, if we have one