Python3: fix syntax issue in _encode_item()

In Python 3, this is not a valid syntax:

    def _encode_item((k, v)): ...

Pass a single parameter to the function, and start by unpacking.

Change-Id: I73743073113a4696b9adc79bdb646575794c1e2b
Merge "Python3: fix syntax issue in _encode_item()"