Risk and cross validation in ridge regression with correlated samples