Nondestructive inspection using pulsed terahertz wave