Added waitTransaction() util

For database whos using singleton locking to prevent deadlock.
Ex. SQLite