Specify nonblocking mode on PTY master

Updates the PTY handling code to set O_NONBLOCK on the master after
opening. After some experimentation, I've found that succeeds on OS X
if done after the call to unlockpt, allowing for a uniform approach
across supported platforms.