qahw: test: Add condition check for fwrite

Add condition check for fwrite operation i.e writing the
recorded data to file and some Bug fixes.

Change-Id: I82f973f486450471df2c9e885f96bf719ca199f6
2 files changed