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.
Test and set std=c99 mode on supported platform.

Also setting Wextra in development mode.