Optimize KillProcesses
Optimize KillProcesses

Tweak the RemoveGroup apis to return if they were successful or not.
Via knowing that, we can infer whether or not we need to scan further-
if the group was successfully removed then we know there can't be pids,
or subgroups within it.

Exploit this knowledge to allow exiting out of KillProcesses early,
bypassing the need to do multiple loops/timeouts.

Finally, optimize the actual rmdir calls so that instead of a sudo rmdir
for each, find builds up the arguments, invoking it all at once.

BUG=None
TEST=time cros_sdk -- true

Change-Id: I07c312c45c483ebf3c8546b52fb6dd40e8120814
Reviewed-on: https://gerrit.chromium.org/gerrit/18339
Reviewed-by: David James <f231dc574bbeb62604660cbc162d1b8642a0a3af@chromium.org>
Tested-by: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>
Commit-Ready: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>

bpsinc-native/src_third_party_chromite,coreos/chromite,bpsinc-native/src_third_party_chromite,zhang0137/chromite,chadversary/chromiumos.chromite,bpsinc-native/src_third_party_chromite,zhang0137/chromite,chadversary/chromiumos.chromite,coreos/chromite,coreos/chromite,zhang0137/chromite