When elf_getdata_rawchunk aquires a new chunk for the first time, it
inserts a stack-allocated dummy chunk into a search_tree with a rdlock
held. When the real chunk is prepared to replace the dummy chunk, the
rdlock is released and a wrlock is then held while replacing the
dummy with the real chunk.
Before the wrlock is held, other threads could incorrectly acquire the
dummy chunk as if it were a real chunk.
Fix this by holding a wrlock throughout elf_getdata_rawchunk.