This patch makes DynamoRIO's private loader add a client library's rpath + runpath to the global search path. This is considered a work around for issues stemming from the fact that currently, DynamoRIO's private loader is traversing library dependencies depth-first instead of breadth-first. From experiments it looks like the native Linux loader does the latter.
This resulted into some cases where DynamoRIO's loader couldn't find libraries that can only be found by considering the client's rpath + runpath. In those cases, the C++ toolchain was adding multiple system dependencies to the client library including a valid rpath, but the system libraries itself did not reflect the same rpath.
The drawback of this workaround is the unability to handle potential corner cases with libraries of the same name in different locations.
Includes a fix for a latent bug that caused overrunning the rpath + runpath string if the path was a list.
Issue: #3850