[BUGFIX] Last read document may crash viewer

If an old reference is stored and the documentation is refactored, the
last read document may lead to a crash of the viewer while htmlizing
warnings.txt

Change-Id: I1eba045e73a71b0f03633cdaaaf90ce5ceaface6
Reviewed-on: https://review.typo3.org/24485
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers