Sync python-gflags with upstream portage.

Somehow I missed that this one already existed but two of my patches to
fix tests are still useful.