Wrap upserting of posts in a transaction.