Optical Synchronization of a Free-Electron Laser with Femtosecond Precision.