Added a fallback case for determining the python library directory.

If matching the scriptname against the runtimepath doesn't work, then traverse upwards from the script name looking for a python directory.