Freezing Transition of the Vortex Liquid in A Layered Superconductor