[#1067] Fix bug which can cause IllegalBufferAccessException when using aggregator and deflater the same time