add console_deinit(), free some leaking memory