Make dependencies respect locked packages on install

This aims to fix
https://github.com/freebsd/pkg/issues/938

Not certain if this is the best place to put it (quite late in the process),
but it seems to get the job done.

The local package wins, won't get removed and the replacement most likely
fails.

This is not a replacement for a proper solution as demanded in
https://github.com/freebsd/pkg/issues/939, but this one will be a lot
more effort and IMHO havig pkg fail due to a conflict is still better
than losing locked packages.