debug
Add mutex around upgrades
Revert "debug"

This reverts commit 2b68f543fd931d44be27f3c2a75777af1fcf8ec9.