gitignore: Ignore more build system products

Ignore static libraries, cmake products, generated code and unit test
binaries.

Some extra care must be taken not to ignore more than intended when ignoring
the *_UnitTests. There is no way to directly express a path-neutral "only
ignore files with this pattern, not directories" in a single gitignore
pattern, but it can be expressed as "ignore everything containing this pattern
except directories".
octave: Avoid deprecated single argument dim_vector constructor

The single argument constructor to dim_vector was deprecated in liboctave 3.4
[1], and gives a compile time warning when compiling with gcc and using a
recent version of liboctave. The two argument constructor is safe to use with
older versions of liboctave.

[1] http://hg.savannah.gnu.org/hgweb/octave/rev/12884915a8e4