Fix errors in SparseBlockOuterSS c_code.

This gives a numerically wrong gradient in addition to occasionally crashing the GPU.

Apparently it just randomly works with batch size = 4 so I set the test batch size to 2, which exhibits the crash without this fix.