Gracefully handle invalid number of sections in header.

Attempt to handle invalid section references inside the ELF
header, previously it was just referencing outside of the file
and causing it to die. This should log an error/warning and try
to continue processing. More information about this can be found
here;

http://dustri.org/b/?p=832