Bring back getExecutablePath to getBaseDir on OpenBSD
I included a couple of semi-related changes that only pertain to OpenBSD.
I reverted the previous hack I committed because it's no longer needed after an OpenBSD change.
Fix #18173 (closed) Fix #23011 (closed)