CRED: Wrap task credential accesses in the key management code