pkg-(add|install|upgrade): Respect locked packages on forced invocation.

This re-establishes pkg 1.2 behaviour.

This replaces the previous pull request, this time against master and not the release branch (back porting is trivial and I'd recommend it, assuming this patch is considered sane)