fix ptsname_r to conform to the upcoming posix requirements it should return the error code rather than 0/-1 and setting errno.
add ptsname_r (nonstandard) and split ptsname (standard) to separate file this eliminates the ugly static buffer in programs that use ptsname_r.