Extension of second-order Stokes theory to variable bathymetry