Fixed the Linear stage when the output size is 1.

addmm wont work when the output dimension is 1 which causes Linear to fail.  At the cost of another lua branch conditional, this fixes the resultant error.  I've also added a test for this special case.  Soumith, please have a look over the code and make sure there's nothing stupid here (I wouldn't want to break Linear).