files/toolchain-shar-extract.sh: Rework PATH cleaning
Trying to create a clean PATH breaks cases where we install a buildtools tarball
on hosts to provide newer versions of gcc. Rework the fix for #8698 to clean up
directories in PATH which don't exist isntead. Do it with python as the shell
version was too fraught with corner cases.
(From OE-Core rev:
7674b63819aa7ca95ca5ca5477a5cce32e9691eb)
(From OE-Core rev:
9825236deacf6eb311121d233435a46288c02cdb)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>