Adds Optix error handling.
Locked mutex to prevent exception. Research if fix is correct