Fix issue #48.

On some platforms, OS X Mavericks, the inferior is allowed to close the
psuedo terminal that cgdb allocates for it.

Before this fix, CGDB would go into a tight loop consuming 100% cpu
reading the EOF on the closed terminal descriptor.

After this fix, CGDB detects the EOF and reallocates a terminal for the
inferior. The user can then run the inferior again in the same GDB session
and all should work well.