Rebase custom sudo code to common implementation.
Rebase custom sudo code to common implementation.

In the process, this fixes timeouts that can/do occur during
cros_sdk --bootstrap .

Note that this is able to induce user visible changes- specifically
an info notice that sudo passwords are being asked for.  That goes to
the pty or stderr, meaning any sane consuming programatic code
cannot be affected.

It is worth noting that that code is already a source of bugs due to
the fact cros_sdk can/will build a chroot if needed prior to executing
the requested command; in other words, that code is already potentially
broke regardless of this change, since the output of the build most
definitely goes to stdout.  Regardless, this code doesn't change the
output to stdout for consumption.

Additionally, this output cannot occur during buildbot runs unless
cbuildbot code itself is broken...  In which case cbuildbot should
be fixed, rather than hacking this utility.

For cros_sdk, this expands the previous sudo authentication from
just the invoking tty to include 'unknown' tty_ticket.  This is
intentional.  As we already have seen with cbuildbot, those usages
can pop up and are very, very hard to spot in code, as such (and
as part of killing the sudo issue once and for all) 'unknown'
tty_ticket is now authed.

Finally, fix goofy imports and a couple of pylint complaints
while I'm in the file.

BUG=None
TEST=cros_sdk --delete && cros_sdk --bootstrap

Change-Id: I01bb1466cf027401fa387af7fad15e42fd33aea4
Reviewed-on: https://gerrit.chromium.org/gerrit/15180
Tested-by: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>
Reviewed-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>
Reviewed-by: David James <f231dc574bbeb62604660cbc162d1b8642a0a3af@chromium.org>
Commit-Ready: Brian Harring <fdc2d0a2e2340b623587cee5ea8dff425d1eb1f3@chromium.org>

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