sdk: avoid using different state (#4505)
sdk: avoid using different state (#4505)

I noticed that when operating on opa.state, locking is usually done to avoid
a race, whereas here opa.state is used directly. By comparing the previous
changes, I found that #4240 changed the previous behaviour.

This change adjusts that: we ensure that we work on the state as read via
the mutex-protected `s := *opa.state`.

Signed-off-by: Iceber Gu <78ca334faffe22661af7aca8231f7bac3769751c@daocloud.io>
open-policy-agent/opa,tsandall/opa,tsandall/opa,tsandall/opa,open-policy-agent/opa,open-policy-agent/opa,tsandall/opa,tsandall/opa,open-policy-agent/opa,open-policy-agent/opa,open-policy-agent/opa,tsandall/opa