build-docs: cleanup exit of the script