Test for singular matrices in Ridge regression

This is a test for 8b9b4e447b234b30a9105529dbe1935801823d7e
I've also made the _solve_svd function more robust for the
case where alpha is zero.