fix 'with nogil' blocks inside of generators in C++ mode