Trailing blanks and Resource leaks caught by static scan check

Coverity scan check caught several places with possible problems.
Also cleaned-up and removed several trailing spaces.
Trailing blanks and Resource leaks caught by static scan check

Coverity scan check caught several places with possible problems.
Also cleaned-up and removed several trailing spaces.
Argument cannot be negative

Re-wrote GFileReadAll() so that fread wouldn't get -ve value.
Re-wrote GFileGetSize() to accept larger file sizes on smaller CPUs.
Trailing blanks and various errors caught by static code check
Merge pull request #750 from JoesCat/master

more code improvements and error checks