Fix duplicate detection when target has no sources.

See https://github.com/pantsbuild/pants/issues/176.