Updates to allow building on OS X.

OS X (along with OpenBSD and NetBSD) puts forkpty() in libutil.h, and
requires -liconv.