build.gradle: exclude duplicates from generated jar files

Now that gradle can do it, do it.

Not applied to the fatjar plugin, though. Not sure of the consequences.