Improved prediction for the mass of the W boson in the NMSSM