The slash is coming from the $_SERVER['REQUEST_URI'] variable.
Maybe you can add an if statement to check if the current page is the home:
if(is_home())
$url = get_bloginfo('url');
else
$url = 'http://'.$_SERVER["SERVER_NAME"].$_SERVER['REQUEST_URI'];