Add query function for closure info

I need this to correctly report errors in the render. Well, I could do it without this, but with this function I don't need duplicated data and everything is centralized in OSL.