allpages.py: fix namespace param type

If namespace is a Namespace object, str(namespace) returns the name of
the namespace and not the index.
In the API query, the param will not be recognised as valid.

Bug: 73214
Change-Id: Ib69522bf8fc62cdd8815f45bfa7e9fb5c88f864e