engine: use lua_type() to check lua types when converting to gvariant
This is because using lua_isnumber() for instance returns true if there is a string that contains a number and it ends up doing unwanted type conversions.
ex. "1234" in lua would be converted to 1234.0 (double) previously