Validate chunk data array lengths. Fixes BUKKIT-4093

If a chunk has somehow managed to save with arrays that are not 4096
entries long when reading them again we will get exceptions. Checking the
array length and resizing if needed is cheap so we should do this to help
avoid crashing servers due to this error.

Remapped by Srg2Source from Bukkit/CraftBukkit@13c74c16346c4610b59964b4b2f60d5120ed3627