elf: avoid stack allocation in dl_open_worker