Cperello/better error handling in openchange

I don't expect too much troubles merging this into 3.3 and master