Bug 951058 - correct chrome sub-dirnames iteration for the generation of xpi

dirpath is the full path of the addon. template_root_dir is the path of the addon sdk.
What we want to use here is pkgdir in order to have a relative path.