Close resources in reverse order of acquisition.