In `media_sideload_image()`, check the returned value of `download_url()` earlier to avoid attempting to `unlink()` an instance of `WP_Error`.

Props georgestephanis. 
Fixes #28204.

Built from https://develop.svn.wordpress.org/trunk@28567


git-svn-id: http://core.svn.wordpress.org/trunk@28392 1a063a9b-81f0-0310-95a4-ce76da25c4cd