Distance, magnetic field, and kinematics of the filamentary cloud LDN 1157