TargetList::CreateTarget automatically adds created target to the list, however, CommandObjectTargetCreate does some additional preparation after creating a target and which can fail.
The command should remove the created target if it failed. Since the function has many ways to return, scope guard does this safer.
Changes to the TargetList make target adding and selection more transparent by splitting CreateTarget into two parts: creation and adding to the list.
Other changes remove unnecessary SetSelectedTarget calls after CreateTarget.