[MRG] More informative numerical error message in SGD

Also add a test.

Ping @pprett, @mblondel.