Tweak code so we don't loose the record data pointer.

By using the dcr->rec we should preserve the rec->data pointer
as new_record allocates memory for that and we overwrite it
in the append data and ndmp write function. Also as the dcr->crec
always has a data pointer pointing to a converted internal buffer
we don't need a record there with a data pointer allocated so added
an extra argument to new_record that signals that we don't want to
have a data pointer allocated. The default of this argument is true
(protos.h) so we don't need to change all calls of that function.

Also fixed some warnings from the compiler.