allpages.py: fix namespace param instance checking

Namespace param can also be a Namespace object and not only an int.
Fixed also alllinks().

Bug: 73214

Change-Id: I306ad0933b5836c86bcd105a820a0fd8ca78358f
Merge "allpages.py: fix namespace param instance checking"