tarball: extract safemembers() from within _uncompress_tar()
No need for it being a dynamically defined function, plus it makes pydocstyle very unhappy (probably a bug in pydoctyle 4.0.0 but...).
Also rename it as _safemembers() for consistency sake.
Migrated from D1706 (view on Phabricator)