ndomod_register_callbacks(): Refactor for less repetition.

A macro to combine common code for optional callbacks. Change
NDOMOD_PROCESS_STATECHANGE_DATA to NDOMOD_PROCESS_STATE_CHANGE_DATA so
it agrees with similar symbols.
ndomod: Free memory allocated for config options.

Memory allocated for config string options wasn't being freed on module
unload, leading to small leaks on Core reloads. Fix this and touch up
the *_deinit() functions.