Properly free hal ctx when finished with it.