Redefine ws_object_deinit

This PR redefines `ws_object_deinit` to invoke all deinitialization callbacks for a type.
Targets #372.

Note: I didn't go through all the deinitialization callbacks yet.