ata: fixed up doWrite() with similar fixes recently done in doRead()