Patterns of uptake of HIV testing in sub-Saharan Africa in the pre-treatment era