A protective role for cell-mediated immunity in HIV infection