Improve error handling

The old code meant that find_in_file() would die() when the file was
not found. It is normal for md.log to be unable to be found when (say)
grompp failed because (say) a warning was added. So this should not
cause the test harness to try to exit completely. Returning a value to
indicate that no match was found is a reasonable behaviour. Other
clients of find_in_file() are mostly of grompp.mdp and shell
redirects, which will always exist (and also, they didn't depend on
the death behaviour being changed here).

Also fixed the top-level map { eval }, so that it properly implements
a try-catch-throw pattern. This means that error messages from die()
are not swallowed silently. Not doing this causes mysterious problems
if an error condition uses die(), because the working-directory
assumptions of the next statement in the map { eval } can be violated.

Change-Id: I27665a6e7e7bcbe3801eb024605aac0fa8c51d0f
Respect rank/thread maximum in CPU reruns

CPU-only reruns done after GPU-enabled tests didn't respect MPI rank
and OpenMP thread count limits.

Minor refactorings to re-use variables that contain the names of the
files that limit attempted parallelism, and to clarify how the
rerun sets up its directories.

Fixes #1624

Change-Id: I58210e37129d725ef2fe2e7b1ff3c2b5ecfb5d74
Fix propagation of runjob flags on BG/Q

This got left behind in a recent refactoring. Also re-enable
./gmxtest.pl -mpirun "runjob --some-local-flag"

Also added helpful hint to do the above.

Change-Id: I051453f0e9fc1f4670cf4d07ca413e184a7b779f
Merge branch release-5-0

Change-Id: Ia100e363be8c3a469248965d378974bd54a49123