nmsg_io: Stored reference to cb functions to fix segfault.

fixes #2