ElfParser: big speed up + raise exception if buffer is too smal to contain a header

See commit message for benchmark.