array: fix unit tests, add test for realloc resize
array: add check for resizing without growing count, with fixes