Check parameters strictly.

calloc in C99 is expected to return NULL when (nelem * len == 0).