Added ainv_wait and wakeup (chal_attempt_ainv) support based on brand_
implementation.

Also, added static invocation support in the ainv stub. So when acap
manager lookup returns a static cap, the client thread will do static
inv correctly.