which.py: optimization: avoid calling os.path.isfile() unless it is a match; makes the command complete instantly instead of after a second or two