Correctly implement PKCS#7 padding.