Newlib's setvbuf function is very old and has two bugs:
- It sets the SRD/SWR flags incorrectly in case of files opened for
reading and writing.
See https://cygwin.com/ml/cygwin/2016-03/msg00180.html
for a desription of the effect.
- It always sets the buffer size to BUFSIZ if it's not provided by
the application, independent of the optimal blocksize for the
underlying IO device.
Update setvbuf to latest code from OpenBSD to fix both problems.