Ignore .so files with soname versioning builtin when linking kegs

`.so` files can be versioned, a la `so.4.5`.  This patch ignores such files when searching for non-lib files during linking.

This was [moved over](https://github.com/Homebrew/linuxbrew/pull/121) from linuxbrew as it shouldn't change anything on other platforms.  @sjackman suggested I change the list of `valid_extensions` to regexes and merge this case into the list, but that would change the existing logic a fair bit and I wanted to see if the current incarnation is sufficient for mainline Homebrew.