Backport "system-image-upgrader: fix a bug on path matching"

commit 5be0ddac4179b018c70ba33d444783adf2f0c2b6 in Ubuntu Touch
phablet CM tree.

Change-Id: Ib9cd98f019003a20a7249cd672c3c3acba85940e