"Ce qui" and "ce que" are relative pronouns like "qui" and "que"; they introduce a subordinate clause. The choice between the two depends on the grammatical role, subject or direct object, that the relative pronoun has in the subordinate clause.
Mais je n’avais qu’à l’étouffer en imaginant ce que seraient mes pensées dans vingt ans quand il me faudrait quand même en venir là.
In writing this sentence the author has made the entire clause "ce que seraient mes pensées" object of imaginant. It is very difficult here to consider the relative pronoun as a subject to *seraient", "ce qui" would sound awkward to a French ear here.
To be able to use "ce qui" you'd have to rephrase the sentence so that the relative pronoun would become subject of a verb.
- Not changing the verb of the relative clause:
Mais je n’avais qu’à l’étouffer en imaginant ce qui seraient dans mes pensées dans vingt ans quand il me faudrait quand même en venir là.
Introducing "dans" definitely makes "ce qui" subject of "seraient"; "mes pensées" becoming an adverbial phrase of place.
- Using a different verb in the relative clause:
Mais je n’avais qu’à l’étouffer en imaginant ce qui occuperaient mes pensées dans vingt ans quand il me faudrait quand même en venir là.
"ce qui" has become subject of occuperaient.