Fix race condition in associative domain member() function

[reviewed by Ben]

This patch fixes a race condition when using the member function in
parallel with modifying an associative domain.  During resizing
(e.g. in dsiAdd()), the domain is temporarily emptied.  If the member
function is called simultaneously, it can obtain an invalid "high"
range value of -1 which eventually leads to a divide by zero.

To fix this, the table lock sometimes needs to be acquired for
_findFilledSlot().  We do not want to always grab the lock as it may
have already been acquired by a calling function or, as in the case of
dsiAccess(), we do not want to acquire the lock (general access is not
guaranteed to be parallel-safe).

Changes:

- Add a param argument to _findFilledSlot() that states whether or not
  the lock should be acquired

- While in there add comments on other functions that assume the lock
  has been acquired and change array accesses to use [] instead of ()

- Add a stress test for parallel member() and add()



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23648 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Consolidate system() calls in driver.cpp

[reviewed by mike]

This patch consolidates the 23 system() calls used to set up the env vars
in driver.cpp into a single popen out to printchplenv. Each of those calls
also created a temporary file that was used to read the output back into
the compiler. In my tests on the chap boxes, the time in init dropped from
~.5s -> ~.05s after this change, the difference is even larger on my mac.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@23649 3a8e244f-b0f2-452b-bcba-4c88e055c3ca