util/fossilize_db: Fix double free in error handling.

If the file ptr is not NULL then foz_destroy will also try to destroy it.

Fixes: eca6bb95 ("util/fossilize_db: add basic fossilize db util to read/write shader caches")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <!14671>
166 jobs for !14671 with cache-open-fix in 98 minutes and 46 seconds (queued for 9 seconds)
latest merge request
Name Stage Failure
failed
iris-glk-traces-performance Intel
Uploading artifacts for failed job
Uploading artifacts...
results/: found 7 matching files and directories

Uploading artifacts as "archive" to coordinator... ok
id=17963299 responseStatus=201 Created token=948uxu63
Uploading artifacts...
WARNING: results/junit.xml: no matching files
ERROR: No files to upload
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
iris-whl-traces-performance Intel The script exceeded the maximum execution time set for the job
  job:
minutes: 80
visibility:
group:
- Collabora+fdo

2022-01-24 02:04:48.409714: LAVA job id: 5502895
2022-01-24 02:04:48.409813: Waiting for job 5502895 to start.
ERROR: Job failed: execution took longer than 1h0m0s seconds
failed
a630-traces-restricted Freedreno
Uploading artifacts...
results/: found 33 matching files and directories

WARNING: serial*.txt: no matching files
Uploading artifacts as "archive" to coordinator... ok
id=17963452 responseStatus=201 Created token=g57sXXDu
Uploading artifacts...
results/junit.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... ok
id=17963452 responseStatus=201 Created token=g57sXXDu
Cleaning up file based variables
ERROR: Job failed: exit code 1