Merge "fix a race condition in undoDequeue(), where 'tail' could be computed incorrectly." into kraken