Forward and backward THz-wave difference frequency generations from a rectangular nonlinear waveguide