Set instance.name before starting instance runloop
Fix race between cmdtask shutdown and process closure handler