build: fix `python_finder`: prefer python2, look for/prefer .so

This fixes building YCM / ycmd for pyenv with python3 and python2
activated/configured.
Similar here. Also, you should probably extract this into a function (same above); that way the logic for picking python/python-config is separate from its use. This will increase readability & maintainability.