Calculation of positron lifetimes in bulk materials