A quantum cure for the Ostrogradski instability