stdbuf ripped from FreeBSD, for Mac OS X.