javax.crypto.CipherSpi: port this class from jdk8u60

Changes made upstream in
CipherSpi#bufferCrypt(ByteBuffer input, ByteBuffer output)
- when the input is not backed by an array, do not call get() for
a chunk of size 0. This doesn't change behaviour, as for the size
of the chunk to be 0, the size of the input must be 0, and this
is checked earlier in the method (it returns early in that case).
- do not call the "position" method when finishing reading from a
buffer not backed by an array.
- do not call put() when writing an output of size 0 to a buffer
not backed by an array.

Bug: 29631070
Test: vogar CipherSpiTest
Change-Id: Id803bc6d9df0c1711f3cf7e5d49751bccd0e91b3
2 files changed