examples/avio_reading: fix null dereference on error