A finite element method for 3D hydrostatic water flows