Commit 05be6a1 refactored reading from the pipe to detect when the
Sender should set the halt flag in the audio message so the Receivers
can detect that the continous audio stream is paused.
The way the commit detects when to set the halt flag has a drawback: it
depends on the audio producer to not write any data to the pipe after a
"stop" command was send to the user command handler. If the producer,
e.g. arecord reading from an audio input, is still writing to the pipe,
a "stop" command will not pause the audio stream, which is quite
unfortunate and not the expected behaviour.
Therefore, do not depend on the audio producer, but open and close the
audio reader. This way, when issueing the "stop" command, the audio
reader is closed and no more data are read.
When the timer expires after the audio reader was closed, it will send a
last audio message with the halt flag set, and will not fire again. The
audio stream is paused until the "play" command is issued again.