The following claim is a consequence of Gronwall's theorem
Let $x \colon [0,\infty) \to \mathbb R$ with $x(0) = 0$ be a continuously differentiable function, whose derivative satisfies $$ \dot x(t) \le a(t)x(t) + C$$ with a constant $C \ge 0$ and an integrable function $a \colon [0,\infty) \to (-\infty,0]$. Then we have $$ x(t) \le tC $$
See e.g. this blog post.
Gronwall's theorem can be found in many text books; however, all those that I looked at only considered the case of nonnegative $x$ and $a$, whereas I need $x$ to be arbitrary and $a$ to be nonpositive.
Q: Is there a (standard) text book (which can be cited) that treats this general case?
After searching several books on ODEs I think you could refer to a stronger result, the so called comparison lemma which appears in appendix E.4 of
[1] W.J. Terrell, Stability and stabilization, Princeton University Press, 2009.
In your case $$\dot{x}\leq a(t)x(t)+C\leq C$$ as $a(t)x(t)\leq 0$ for all $t$ by definition. The solution of $\dot{u}=C$ is $u(t)=u(0)+Ct$ and for $u(0)=0\geq x(0)$ the conditions of Lemma E.4 of [1] hold true and therefore $$x(t)\leq u(t)=Ct.$$
The above analysis holds true as long as $x(t)\geq 0$ for all$t\in[0,\infty)$. If $x$ is negative over some intervals then the above Lemma cannot be directly applied but needs a modification.
We consider two cases:
a) If $x(t)<0$ then $x(t)<0\leq Ct$ since $C\geq 0$.
b) For $x(t)>0$ due to continuity (and starting from $0$) there exists a time instant $$t^*=\inf\{s\in[0,t):x(t^*)=0\}$$ which is the nearest time up to $t$ for which $x(t^*)=0$. Obviously $x(s)\geq 0$ for all $s\in[t^*,t]$ and we can apply Lemma E.4 as described before in $[t^*,t]$ to prove that $$x(t)\leq C(t-t^*)\leq Ct$$