python: protect setup.py running.

Cherry-pick and adapted from go/fibercl/67482
Fixes b/27328894

Change-Id: Ic30316eaf42dbd95c752230609f9ca8a74e614bc
14 files changed