glthread: use int instead of size_t where it's OK