Python3 support

This is the fix for http://trac.xapian.org/ticket/346. I am not sure if that's all in that issue but postingsource test case is working now under threads.