Check for and handle duplicate files

Die in the case of a hash collision.
fixes assembla-244 simpler than expected.