Added error checking for the return of all libelf functions