Adds a subshell to enable guaranteed cleanup.