[MP] More robust fix for #450.

There are a number of ways that NaNs can reach the engine, and this is
then processed in R_FogFactor to produce an invalid index. This commit
provides a more robust fix for any NaNs which may cause a segfault.