Viscoelastic behaviour of water in the THz-frequency range: an inelastic x-ray scattering study