[fix] solver indexing of output blobs was incorrect for non-singleton outputs

I was computing the indices of output blobs incorrectly when getting the blob's loss weight, which caused a segfault in certain cases.  Will merge once Travis passes, then back-merge to dev.