Characterization of GaN using thermally stimulated current and photocurrent spectroscopies and its application to UV detectors