Fix build error on 4.x branch if readline is found