hdu: fix File.WriteHdu for darwin