Simply dynamic array implemention in C