Fix problems reported by coverity in NDMP code.

Only fix the obvious problems of code that actually is used.
Change sprintf to snprintf where fixed buffer size is used.