elf: only open file for reading

Otherwise you get permission denied if you try to use `with-mapped-elf` on a write-protected file.