On the stability of the index of unbounded linear transformations