Fix padding on rounded doc size

doc_size lies on real doc size to avoid information leaking, see #8758 (closed)

Either we strip out the \00\00\00\00... added to the document due size being larger than the real one or we use the decrypted size as real size. Returning the full padding together with the real content breaks the expectations, since we had called put with something else than returned.