"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", "ceit can be seen as a predicative nominal (attribut) to "mes pensées". "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 serait 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 "serait"; "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 occuperait mes pensées dans vingt ans quand il me faudrait quand même en venir là.
"ce qui" has become subject of occuperait.