filerelaytest: handle error when opening the output file.
Removed use of err() for Windows compatibility.
afc_file_open: fixed memory leak when the object is not found or arguments are invalid.
afc_file_tell: fixed leak of unnecessary buffer and removed condition check before free.