Move reading LOBs out of the callback thread
Fix memory management related issues