doc-rst: Break shell command sequences on failure
As $(SHELL) doesn't include the -e option, any loop or other sequence
needs to include explicit checks for failing commands.
Fixes: 609afe6b49ef ("Documentation/sphinx: build the media intermediate ...")
Fixes: 606b9ac81a63 ("doc-rst: generic way to build only sphinx sub-folders")
Fixes: cd21379b1698 ("doc-rst: generic way to build PDF of sub-folders")
Tested-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>