MINOR: minimal fix for the long id problem.

Each new file is assigned an id which is a random long. The set of long is small enough (2^64) to induce a (very limited) collision risk (see http://en.wikipedia.org/wiki/Birthday_attack). With this patch, up to 10 ids are generated in order to reduce further the risk and collisions are detected. The long term fix will imply increasing the id to a 2^128 space.