Added derivative of eigenvalues of symmetric rank2.  Fixes #3563

Made a private "syev" function that gets called by both the
eigenvalue and derivative routines.  Also the compiler shouldn't
complain about variable-length arrays.

(This is a continuation of @WilkAndy's PR #3566, rebased and with conflicts fixed.)