Fix issues related to NaN normals in some situations by trying to detect when these cases might occur and just reverting back to default normals. As a side effect of these changes, OSL now behaves correctly when given a non-normalized normal. Pull Request: https://projects.blender.org/blender/blender/pulls/114960