python: fix a pathsearch problem and feature debug build option

when the pathsearch is not run from the python interpreter itself,
it wouldn't find the correct prefix when the prefix used was either
empty or /.
this affected the python plugin of ixchat which caused ixchat to
abort on start with a message that PYTHONHOME was not found.