Ab initio study of the linear and nonlinear optical properties of hexagonal CdSe