fixes #2172

Fixed internal buffer overflow in DefaultPortableWriter#writePortableArray