Development of a novel thermionic RF electron gun applied on a compact THz-FEL facility