RST writer:  Avoid stack overflow with certain tables.

Closes #1197.

Note that there are still problems with the formatting of
the tables inside tables with output produced from the input
file in the original bug report.  But this fixes the stack
overflow problem.