python: Refactor build of dictionary entries for py_get_lockspaces
Use Py_BuildValue("{...}",...) for creating each dictionary entry
in lockspaces list.
Using helper for different path formats:
- Py2: will treat path as PyString using the "s" format.
- Py3: will treat path as PyBytes using the "y" format.
Current status:
- Py2: will build and pass tests.
- Py3: will fail to build for missing respective API calls.