rtld: Fix null-pointer dereference
(cherry picked from commit 43d44842aef3972cc86ce673e84e31f372257b15)