Fix string.* functions to coerce number into string like Lua does

Lua uses luaL_checklstring on arguments in string.* functions to ensure they are strings or numbers and coerce numbers into strings.

Introduce a check_string() function that does the same and use it for supported string.* functions