Previously, there was no check that the file is non-ELF before trying to read
the ELF header. This led to segmentation faults while loading non-ELF files
(e.g., bash scripts). This commit adds an explicit check, as well as the
corresponding PAL regression test.