Fix LD_LIBRARY_PATH test for all platforms