Check the results of mesh file writes
writeMeshData() made fifteen device->write() calls and checked none of
them, and Mesh::save() returned a valid id whatever happened, so a
device that filled up part way through produced a truncated .mesh file
and told the caller it had succeeded.
Route the writes that bypass QDataStream through one checked helper,
test that and the stream's status once at the end, and have save()
return 0 when the data could not be written.
Change-Id: I3b9506da046747a7058fb0b2b44d4e9af60fa285
Reviewed-by: Christian Strømme <christian.stromme@qt.io>