Improved robustness based on criticism in GitHub pull request.

https://github.com/D-Programming-Language/phobos/pull/1090#discussion_r2721440