fix guard state

the guard decorator was not thread-safe. This allowed perpetrators to
let other users execute controller functions with manipulated
parameters. However, I could not find any critical exploits based on
this bug.
Merge pull request #905 from xi/feature-fix-guard-state

fix guard state