Daily OS X fix.

Patch also fixes NetBSD and OpenBSD, but I can't test that.

<pty.h> is <util.h> on some BSDs.
Merge branch 'stal888-patch-6'