Measuring fusion excitation functions with RIBs: A thorough analysis of the stacked target technique and the related problems