[utils] Add a function to sanitize consecutive slashes in URLs