Measurement of the 154Gd(n,γ) cross section and its astrophysical implications