Faster full convolution for GpuCorrMM

As a follow-up to #2023, this PR adds [caffe's backward pass wrt. inputs](https://github.com/BVLC/caffe/blob/master/src/caffe/layers/conv_layer.cu#L98) to GpuCorrMM to implement `border_mode="full"`. It passes all the tests and it's about 2-4x faster than simulating a full convolution with a padded valid convolution. On the way, it cleans up the code and adds some more elaborate documentation.

There are some caveats, though, all stemming from the fact that the implementation in caffe is meant as a backward pass for a valid correlation:
* With `border_mode="valid"`, `GpuCorrMM` doesn't flip the kernels, but with `border_mode="full"`, it does.
* With `border_mode="valid"`, `subsampling` is for subsampling the output, but with `border_mode="full"`, it is for upsampling the input.
* With `border_mode="valid"`, `pad` is for padding the input, but with `border_mode="full"`, it is for cropping the output.
* With `border_mode="full"`, it needs a different memory layout for the kernels.

Currently, `GpuCorrMM` directly wraps the underlying algorithm, and `local_conv_gemm()` copes with the different peculiarities, because I wasn't sure whether the `GpuCorrMM` Op should be inserting dimshuffles, kernel flips and `gpu_contiguous`es on its own.

Looking at the end result, although it's quite fast, `local_conv_gemm()` now basically undoes everything that `ConvOp.grad()` does. It might be possible to write an optimizer that replaces the gradient of a valid convolution with a properly parameterized `GpuCorrMM` Op, instead of just replacing the full convolution Op that is part of the gradient (introducing redundant dimshuffles etc. on the way). This way we would leverage the caffe implementation better.
The alternative would be to modify the CUDA code to perform a subsampled, padded, full correlation, as would be expected from a Gpu Correlation Op. This would be cleaner, but it would also mean a lot more work and we wouldn't profit as much from caffe's implementation for the case of `subsampling != (1,1)` or `padding != (0,0)` (granted, this may be an uninteresting case in practice anyway).
/edit: Another alternative would be splitting this into two Ops: `GpuCorrMM` for valid correlation with padding and subsampling (the caffe forward pass), and `GpuConvMM` for full convolution with upsampling and cropping (the caffe backward pass). This way it would be obvious how the operations differ, but the memory layout required for the second Op would still be unintuitive.
Yet another alternative would be splitting it into `GpuCorrMM` and `GpuCorrMM_gradInput`. This way it would be obvious how to use `GpuCorrMM_gradInput` for computing the gradient of `GpuCorrMM`. We could even add `GpuCorrMM_gradKernel` for the gradient wrt. weights; it seems caffe does things slightly different there as well.
In both cases, `GpuCorrMM` should get a `grad()` method to define its gradient (so it can be used directly in a CNN to avoid kernel flipping and whatnot) and `local_conv_gemm()` should still be able to replace any `GpuConv` instances with a gemm-based Op (so it can be used with existing CNN implementations).
Refcounting happens [in the C code in blas.py](https://github.com/f0k/Theano/blob/corrmm-faster-fullconv/theano/sandbox/cuda/blas.py#L747). If the output has the correct shape, its refcount is not modified. If it has a wrong shape, its refcount is decreased and we obtain a new array with `CudaNdarray_NewDims`. We don't touch its refcount.

The net effect is equivalent to how `GpuConv` does it: If the output has the correct shape, its refcount is increased, otherwise its refcount is left as it is and a new array is created with `CudaNdarray_NewDims`. In the end, the refcount of the old output array is decreased (no matter whether it was reused or not; so if it was reused, we have refcount+1-1, otherwise we have refcount-1).
There is a *TODO* marker to decrease the refcount of the old array before allocating the new one in case the shape is not suitable, i.e., to do it like in `GpuCorrMM`.

So I'm moderately sure we would create a memory leak if we increased the refcount. I'm not exactly sure what could have fixed the error @stencilman was seeing, though. I fixed a wrong shape inference for the backprop wrt. weights in case of pad="auto", but I think he always used explicit padding by value anyway.