s3:lib: add per_thread_cwd_{check,supported,disable,activate}() helper functions