icinga2-list-objects: Improve compatibility with Python 2.4

refs #6702