A preconditioning framework for sequences of diagonally modified linear systems arising in optimization