Moments of the derivative of the Riemann zeta-function and of characteristic polynomials