add some more debug output, fix a swap of gmail message id vs. gmail thread id causing excess and incorrect message updates