collect.py: fix open for Python versions < 3.6
The built-in open() function has been updated to accept os.PathLike
objects, as have all relevant functions in the os and os.path modules,
and most other functions and classes in the standard library.
Fixes following issue:
File "misc/collect.py", line 260, in scan
with open(ppath, "r", encoding='utf-8') as file:
TypeError: invalid file: PosixPath('tests/profiles/snapshots/targets/ipq806x/generic/profiles.json')
Ref: https://docs.python.org/3/whatsnew/3.6.html
Signed-off-by: Petr Štetiar <ynezz@true.cz>