implement a built-in "os.path.basename" function