xapian-bridge C port

endlessm/eos-sdk#2463
I went with a slightly more robust approach, where I try to connect to the server in a loop before declaring setup "done".