Fix adding software to agent

There was a mistake in the code that led to the endpoint fetching the
software version by the software's id instead of the version's id.
Merge pull request #220 from guidow/agent_add_sw_fix

Fix adding software to agent