alsactl, amidi: check write() return values to fix compile warnings
Building with _FORTIFY_SOURCE emits -Wunused-result warnings because
write() is declared with the warn_unused_result attribute and its
return value was discarded (the (void) cast does not suppress it).
Consume and check the return values instead: in initfailed() report a
failure to open or write the state file, and in amidi's receive loop
report a short/failed write to the receive file and stop.
Closes: https://github.com/alsa-project/alsa-utils/pull/221 Signed-off-by: Jaroslav Kysela <perex@perex.cz>