fix ptsname_r to conform to the upcoming posix requirements