Fix Python3 support for pipchecker

- Use correct imports for Python3 or fallback to Python2
- In python 3 `.items()` returns an iterator and if we try to delete item in that dict it will raise `RuntimeError`. For that reason is necessary casting to `list` before iteration.