python: Simplify parse_resource() with PyArg_ParseTuple
Replace complex manual parsing code with se PyArg_ParseTuple, avoiding
the backward compatibility issue, and greatly simplifying the code.
The test for invalid resource was modifed to test more types and
combinations, including incorrect number of items, and invalid types for
the path and offset.
Current status:
- Py2: will build and pass tests.
- Py3: will fail to build for missing respective API calls.
Signed-off-by: Nir Soffer <nsoffer@redhat.com>