SCUMM: Avoid potential issues casting invalid values to enum

A compiler could in principle decide that a ResType enum can
never equal 0xFF or 0xFFFF, and thus incorrectly optimize
the ScummEngine::saveOrLoad code. So check the value
*before* casting it.