Backport upstream fixes for 'touch'
Current touch
implementation returns successfully (exit code 0) even when it faces an error (permission denied, non-existent base directory...), which is obviously wrong.
This has been fixed upstream, so this MR backports the corresponding commits.