Fix dicts.peekitem for Python 3.x