MFC r275162:
Init array field in the proper place.

Obtained from:	OpenBSD
MFC r275003:
Add missing headers needed by write().