Dipole reversal in Langmuir-Blodgett films of an optically nonlinear dye and its effect on the polarity for molecular rectification