Effect of trap anharmonicity on a free-oscillation atom interferometer