Index: src/wp-admin/includes/file.php
===================================================================
--- src/wp-admin/includes/file.php	(revision 47420)
+++ src/wp-admin/includes/file.php	(working copy)
@@ -550,6 +550,13 @@
 		} else {
 			$url = admin_url();
 		}
+
+		if ( PHP_SESSION_ACTIVE === session_status() ) {
+			// Close any active session to prevent cURL from timing out
+			// when attempting to connect back to the site.
+			session_write_close();
+		}
+
 		$url                    = add_query_arg( $scrape_params, $url );
 		$r                      = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );
 		$body                   = wp_remote_retrieve_body( $r );
