vm: expose cachedDataRejected for vm.compileFunction
Having this information available is useful for functions just as it is for scripts. Therefore, expose it in the same way that other information related to code caching is reported.
As part of this, de-duplify the code for setting the properties on the C++ side and add proper exception handling to it.