scripts/upload_manifest: Fix symlink permissions

The os.stat() function follows symbolic links. Upload_manifest.py
therefore fails when it encounters a symlink that's missing its target
file on the host. Fix the code to use os.lstat() to look up the
permissions for symlinks.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts/osv: Add support for symlinks in filemap.py

Currently, filemap.py generates a manifest file where all files are
mapped by their path. This causes upload_manifest.py not to consider
symlinks and simply upload a copy of the target file.

Fixes #539.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>