Permit test cases to limit their own parallelism

Test cases are sometimes small by design, and some of them use
algorithms that are only available if there is a single rank. The
test harness can now be told do do the right thing without needing to
run the test in default mode and adapt to failure. Used this
for several test cases.

Also added equivalent functionality to limit the number of
OpenMP threads, but this is unused for now.

Refs #1534

Change-Id: I3ba5716ef6445a8da8dfc9918870ddebec26061a