Added functions to manipulate LD_LIBRARY_PATH to os::libraries.

Also added a utility function to expand a library name to a filename
by prefixing "lib" and adding the default extension.

Review: https://reviews.apache.org/r/26903