Locally asymptotically optimal tests for nonlinear time-series models