refactor(spm-package) resolve pkg dep from current to root

Close https://github.com/spmjs/spm/issues/1100

依赖查找改成由下往上查找，感觉这样更合乎逻辑，多出来的性能消耗理论上应该是比较少的。