[docs] Enable doctest for .md documentation files
The current invocation of doctest from GH actions picked up only .rst files.
We enable .md files also, and we make a few changes to ensure that the
doctest passes on the existing files.
The changes fall into several categories:
* add a newline before the end of the code block, for doctest to
pick up the expected output properly
* update the expected values to match the current behavior
* disable some doctests that raise expected exceptions, whenever
I could not get doctest to match the exception details.
Sometimes +IGNORE_EXCEPTION_DETAIL was enough, and other times
I had to use +SKIP.