Fix `pkg install -R` not installing missing dependencies

This is fixed by including missing dependencies into the jobs
after including the upwards dependencies into the list.

Fixes #430