Delete confusing and unused include/origin.h.

The real one in use is origin.h
Fix apply cache issue on permission problem.

Calling a function with necessary permission will cause apply_cache to
be filled with a "non-exist" result, and later calls with enough
permission will still not be able to call it.

Fixed by explicitly return as runtime problem on access permission denied.
It also skip the cache filling on such errors.