upload_manifest.py: Fix crash when files have non-ascii names

Python is notorious for crashing when strings have non-ascii characters
in unexpected places, and unsurprisingly, we were bit by this too...
In the apps/node-demo module, a couple of files have non-ascii names
(using some CJK characters), and upload_manifest.py crashes while trying
to upload the files into the image.

Unfortunately, each of python2 and python3 are crazy in their own way
when it comes to string handling, so getting this to work on *both*
python2 and python3 was a real nightmare. But here is the result.

This patch is necessary for using the "apps/node-demo" module.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>