changing a few ast_delete to ast_unref in places where the to-be-deleted maybe coming from some other place
fixing a few leaks - code_write doesn't delete the code object anymore, code_cleanup has to be called
removing this dead code_init call