Adjust errno on failed prepwrite.

Obtained from:	Apple Inc. (Libc 997.90.3)
Phabric:	D442
MFC after:	1 week