Make sure we include config.h before including twain_i.h. Fixes an activeDS.deviceHandle corruption bug.