fix gcc -Wold-style-cast warning
fix some gcc -Wreorder warnings
assert that we get a valid Root enum value in LuaFS ReadDirectory

An invalid value should be caught earlier on (by
LuaConstants::GetConstantFromArg)