Nearly Optimal Quantum Algorithm for Generating the Ground State of a Free Quantum Field Theory