Packager: Fix dependency detection

Apparently local wipes the value of $? and not unsetting conditionally
set variables results in bad output.