Determination and stability analysis of the supermodes in nonlinear directional couplers through a variational approach