OSMesaMakeCurrent seems to expect that it will be called only once, because each time it ends up creating a new osmesa renderbuffer from the given buffer and calls _mesa_add_renderbuffer to attach it to BUFFER_FRONT_LEFT.
Ignoring the performance implications of this if you're trying to use OSMesa with multiple contexts, this ends up triggering an assertion in renderbuffer.c _mesa_add_renderbuffer -- it asserts that there's no currently attached renderbuffer at that attachment point, but of course there will be, from the previous time that OSMesaMakeCurrent was called.
I'm not sure if this is currently leading to leaks of the renderbuffer structures if the assertion is ignored; an easy fix would probably be to check if there's a buffer attached to the gl_buffer, and if so, to detach it before attaching a new one. Not sure how to do that code-wise, though.
I think that a patch to fix this has been applied to the 7.8 branch, to be released in 7.8.3.
Please reopen if you can reproduce this problem using 7.8 from git.
*** This bug has been marked as a duplicate of bug 10966 ***