fix(transactions): reject queries using a transaction that has already finished (committed or rolled back), closes #2082