mescc: Mes C library: Move common getcwd, open bits to posix.