python: fix leaks when setting constants in wrappers

PyDict_SetItemString does not steal a reference to the value; the caller
is still in charge of its reference if it is set.

See the example in the PyDict_Next example[1] in the Python docs.

[1]https://docs.python.org/2/c-api/dict.html

Change-Id: Ib4927db09ae3f32161b1af4434a8965bb590987d
Merge topic 'fix-python-leak' into master

99553388 python: fix leaks when setting constants in wrappers