Fix a problem when renaming. I don't entirely understand what goes wrong but it can be reproduced like this:

project:

main.h:
==============================
#ifndef main_h
#define main_h

class Widget
{
public:
    Widget();
    void func();

    enum { E = 12,
           A = E + 1 };
};

#endif
==============================
main.cpp:
==============================
#include "main.h"

void Widget::func()
{
    int a = E;
    ++a;
}

int main()
{
    Widget w;
    w.func();
    return w.E;
}
==============================

Now rename the E (from its declaration) to aa. Somehow the renames in
main.h do not happen. Seemingly due to the loop in with-temp-buffer
just ending before it should. This somehow fixes it. Very strange.