rewrite restoring of LD_LIBRARY_PATH with split/join