Krein's resolvent formula for self-adjoint extensions of symmetric second-order elliptic differential operators