added more handle checks to API layer
Merge branch 'master' of https://github.com/embree/embree