Fixed incorrect 'delete' to be 'delete []'

Caught by 'cppcheck' tool.

Change-Id: If3daa8766e21094e04a1d913fa767ad2c7d5fe97
Added many missing fclose() calls, mostly in error branches

Various early return branches were not balancing
fopen() calls with fclose().  All tests still pass,
but I doubt there is coverage of these failure branches.

Caught by 'cppcheck' tool.

Change-Id: Ib8df8586ba6195db8c06d890c1288cd57b0b33c5
Merge topic 'cppcheck-fixes' into master

218f599b Added many missing fclose() calls, mostly in error branches
e8dc5f09 Fixed incorrect 'delete' to be 'delete []'