Fix media URL generation error when LinkProvider has AlwaysIncludeServerUrl enabled.

Links would be generated such as /http://foo/~/media/bar

Fix courtesy of @PetersonDave, who is too lazy to send me a pull request ;)