fix data races
add `make testrace` to travis
replace WaitGroup by Mutex in blockingEngine due to data race
Merge pull request #86 from tschottdorf/fixrace

fix data races and have travis check for them in the future
A test framework for verifying concurrency anomalies

Introduced a new framework in kv/txn_db_test.go which makes it relatively
easy to construct transaction histories and then play out every possible
enumeration of priorities, isolation levels and interleavings of txn
commands. The resulting database state can then be checked for evidence
of concurrency anomalies.

This is now used to check that Cockroach's SI and SSI implementations
do not exhibit common anomolies: lost updates, inconsistent analysis,
phantom reads, and phantom deletes. Further, it verifies that the SSI
implementation does not exhibit write skew and that the SI implementation
does.

This unittest framework discovered a great many edge cases which were
bugs and also various performance issues. So it was pretty successful
by that metric. Will be adding tests to this file over the course of
the next few months. There are several other anomalies worth testing.
Also, I'd like to verify we avoid starvation scenarios.

Some additional changes:

 - Gave the retry/backoff harness an ability to reset itself via a
   RetryStatus instead of just returning a bool.
 - Gave retry/backoff random jitter to avoid synchronization of
   degenerate behavior amongst concurrent actors.
 - Eliminate immediate initial heartbeat on transaction; most txns
   will finish long before they need to heartbeat to be kept alive,
   so this saves some unnecessary traffic.
 - Created a new storage.BaseDB class which eliminated a duplicate
   implementation of storage.DB and made it much simpler to wrap
   a database -- we needed this to correctly implement kv.TxnDB,
   but it had the side benefit of eliminating the pedantic
   storage.testDB implementation.
 - Pretty much complete overhaul of 1st cut of kv.TxnDB. Lots of bug
   fixes, better layering to support the test harness, and better
   comments.
 - Added a Transaction.Name field to the proto for better debugging.
 - Added Transaction.Restart to localize all adjustments necessary
   to restart a transaction in-situ. This avoid leaking these details
   into multiple places in the code.
 - Added Timestamp and Transaction String() methods for debugging.
 - Gave timestamp cache entries knowledge of whether the entry is
   for read-only or read-write commands. This is crucial to handling
   abort on writes-too-old errors while still handling the case of
   a DeleteRange affecting the timestamp cache.
 - Check whether or not methods being executed in Range deserve to
   use the timestamp cache--only "real" db methods should. The others
   (e.g. push transaction, etc.) were just wasting space there.
remove echo from Makefile
Address review feedback