[PATCH 12/14] python: Streamline py_get_lockspaces()