Remove all sys.exit calls in the cloud/s3 module

Fixes #4458