A comprehensive error analysis for extraction of complex optical constants by THz-TDS