An improved cosmic crystallography method to detect holonomies in flat spaces