The key thing to resolving this is that you should write $\delta{\dot{x}}$ instead of your $\delta{y}$, and then relate $\delta{\dot{x}}$ to $\delta{x}$ via an integration by parts. This is because your functional depends only on $x$, hence a variation of $x$ induces a variation in $\dot{x}$; so their variations are not independent. Ill work with the cross term and leave the other parts to you.
So you have $$\int...+\bigg(\delta{x}\delta{\dot{x}} \dfrac{\partial^2 f}{\partial x \partial \dot{x}}\bigg)+...$$
This is the correct way to write the cross term; for some reason you also have an extra $\partial$ sitting there; be sure to check this is the correct way to write this; again this is just taylor expansion (at least if you are working in a physics setting; it needs a bit more mathematical care if you're doing it fully rigorously).
The above can be rewritten as:
$$\int...+\bigg(\delta{x} \dfrac{d(\delta{x})}{dt} \dfrac{\partial^2 f}{\partial x \partial \dot{x}}\bigg)+...$$
$$=\int...+\bigg(\dfrac{1}{2} \dfrac{d((\delta{x})^2)}{dt} \dfrac{\partial^2 f}{\partial x \partial \dot{x}}\bigg)+...$$
Hence if you integrate by parts:
$$=\int...+\bigg(-\dfrac{1}{2} \delta{x}^2 \dfrac{d}{dt} \Big(\dfrac{\partial^2 f}{\partial x \partial \dot{x}}\Big)\bigg)+...$$
Which is the desired $O(\delta{x}^2)$ term.