Fixed pinning/unpinning of installed packages

This could happen for version pinning, or when using --force ; the installed set was not updated correctly.
Closes #928 -- thanks again for reporting