s3: make recursive_rmdir function non-static