memoize ensure_privilige function

There are multiple calls verifying same permissions again.
compared to our other memory issues, thus probably wouldn't be a main contributor though I'm not certain, but just *feels* wrong.

anyhow, if you have this function store the result on the request that gets rid of the Dimagi utils dependency