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.