rustdoc: make calls of markdown::render safer

Previously, external code might call `markdown::render()` without having
called `markdown::reset_headers()`, meaning the TLS key
`used_header_map` was unset.  Now `markdown::render()` ensures that
`used_header_map` is set by calling `reset_headers` if necessary.

Fix #17736
Could you actually include this task as part of the `markdown` module itself? It would otherwise need to move to `run-pass-fulldeps` (it depends on the compiler) and also have `// ignore-android` I believe.