Here is one way, but I donβt think you will like it very much:
d1 <- data.frame(x = 1:10,
y = rep(1:2,each = 5),
grp = factor(rep(letters[1:2],each = 5),levels = letters[1:3]))
d1 <- rbind(d1,data.frame(x = 1:2,y = c(NA,NA),grp = c('c','c')))
d2 <- data.frame(x = 1:15,
y = rep(3:5,each = 5),
grp = rep(1:3,each = 5))
ggplot() +
geom_line(data = d1,aes(x = x,y = y,group = grp,colour = grp)) +
geom_line(data = d2,aes(x = x,y = y,group = grp),colour = "blue")

Please note that your solution will not work with other types of data. It just happens that each of the three lines that you want to combine into one and the same category in the legend starts and ends basically with the same spot. If this were not the case, you would end up with unwanted trunk lines.
The above method will work more generally, but, as you can see, is no less inconvenient. If anything is more uncomfortable.
, , . , ggplot2, , (, ) .