If the *msg was NULL there is no memory pointer to free
the nn_chunk_free would get an exception.

This change makes sure that if the pointer is no good
we dont try to free the memory

int nn_freemsg (void *msg)
{
    if (msg != NULL) {
    nn_chunk_free (msg);
    }
    return 0;
}