Dynamic offset cancellation for MEMS accelerometers