Made final_shape work in PoolingLayer.

It does not produce a correct pos_matrix, so it should be close to the
last layer for now.