Coerce args into tuple if necessary.

Same logic as in scipy.integrate.quad.

Fixes #3503 and Fixes #3785.
The try/except doesn't seem necessary, just the ``optimize.minimize`` line is enough. That'll result in a test error if appending ``args`` doesn't work.