HADOOP-11040. Return value of read(ByteBuffer buf) in CryptoInputStream is incorrect in some cases. (Yi Liu via wang)

(cherry picked from commit 47e5e19831a363aa4d675fd23ab0d06e86809094)