Adjust ordering of calls in tiddler_put to generate more efficient sql.
Adjust ordering of calls in tiddler_put to generate more efficient sql.

This avoids 3 redundant selects in favor of grouping up a pile of
inserts.

There are probably similar changes that can be made elsewhere.

tiddlyweb/tiddlywebplugins.sqlalchemy,tiddlyweb/tiddlywebplugins.sqlalchemy