Theoretical analysis of self-phase locking in a type II phase-matched optical parametric oscillator