Fixed a bug in dependency solver and added a test for this bug

There was a bug: when considering constraints of package added to "fixed" set its constraints weren't checked against existing packages in "fixed" set. This PR fixes this a bug and adds a test against it (for regression).