Don't save dependency to component.json when it doesn't resolve

Fixes the case when install is called with --save and the dependecy
is saved to component.json even if it wasn't resolved.
Merge pull request #239 from miloshadzic/save-fix

Don't save dependency to component.json when it doesn't resolve