Check parameters strictly.

calloc in C99 is expected to return NULL when nelem * len == 0.
Merge pull request #1278 from monaka/pr-calloc-improvement

Check parameters strictly.