GRADLE-3170 Idea gradle plugin generates wrong sources jar for multi…

This pull request contains a test and a pretty rough fix for the issue described here:

http://forums.gradle.org/gradle/topics/idea_gradle_plugin_generates_wrong_sources_jar_for_multi_artifact_dependencies