fix missing gc root in ifelse(). fixes #5813