play.js, record.js: Use an enum to keep track of the error messages

The pipeline was sending too many error messages on the bus,
causing multiple dialogs to be launched. Only launch one dialog,
and reset the enum after the pipeline is set to null after eos.
record.js: trivial change