filerelaytest: handle error when opening the output file.