SAPI: Throw runtime error instead of if l_get_mapgen_object called in incorrect thread