Revert "remove overly-defensive state transition mutex"

This reverts commit 1d2788457fd84bff10e921f439927e9304f70842.

Not overly-defensive after all. Passed locally with -race but not on Travis.