check the last pooling in padding and add padded max pooling test

[Adapted from a commit by @jeffdonahue by @shelhamer.]