Fixed S3Api::Init() to work properly with credentials, environment and keys; make env have precedence over credentials (PLAT-553)