[FIXES JENKINS-20276] bestMatch should reflect the search path priority

- The search path may contain multiple matches of the same version
- For example if the search path is /usr/lib64:/lib64:/lib:/usr/lib you can get
  /lib64/libc.so.6 and /lib/libc.so.6, since this is a path, the first
  should win, but because version is always 0 what actually happens is the last
  best match wins.