Don't strip dependencies that are also devDependencies when shrinkwrapping.

This is a version of #3512 with the syntax error fixed and tests added.