Fixed multi-threading memoization issue reported by Jared and David.

Thanks to Jared, who supplied a really helpful example provoking the bug.
Turned on/off multithreading for memoization according to whether waterfall parallelism is turned on/off, as worked out with David Rager.
Installed final (?) patches to allow safe multi-threading in ACL2(hp).

What remains is, probably, to stop defeating memoization in ACL2(hp)
when waterfall-parallelism is enabled.  I've been in correspondence
with David Rager about a possible approach, which he might
investigate.

Note: I have not run regression on these changes, which should only
affect ACL2(p) and ACL2(hp) and have been discussed verbally with
David and Jared.  But I have built both of those as well as ACL2 and
ACL2(h), and run :mini-proveall tests in each.