Use $_SERVER['SERVER_NAME'] when checking whether we're running from within Drush.

Drush sets $base_url to `http://default` if it can't determine the URL. However, PHP does not populate the $_SERVER['SERVER_NAME'] value in this case, so it's a reliable way to determine whether $base_url is going to be valid.