Molecular-dynamics simulation of lateral friction in contact-mode atomic force microscopy of alkane films: The role of molecular flexibility