improved NODE_ADD_CALLBACK macros

This also improves the management of callbacks: Now they will be freed
when the respective class doesn’t need it anymore (i.e. an error
happened).