Fix test running when LD_LIBRARY_PATH is set in the environment.