write.c: fix more compiler warnings on MacOs