[SPARK-3985] [Examples] fix file path using os.path.join

I think the `os.path.join` is fine; I think it's more clear / less brittle.  If it turns out that we do need to make changes to the path separator in order to support Windows, then using `os.path.join` makes it easier to spot where path construction is taking place in order to find the code that needs to be changed.