write error: Make backend format more resilient against disk full

On a filesystem full, the index was updated before the actual data.
As the index is only a few bytes, this could result in a successful
index update but the data block failing to be completely written.
End result is corrupt media (unable to mount).

Swap order:
- Write block of data first.
  If write fails, truncate data file to prior write and return error.
- If write succeeds, write index next
  If index update fails:
    * Truncate index to previous size.
    * Truncate data file to prior write.

Signed-off-by: Mark Harvey <markh794@gmail.com>
write error: Update TapeAlert flag on write error

Signed-off-by: Mark Harvey <markh794@gmail.com>
define TapeAlert meanings in scsi.h

Signed-off-by: Mark Harvey <markh794@gmail.com>