[core] Use os.path.join to fix an issue with some non-posix platforms