Ensure that there are switch work units for LSM trees that need them.

Two cases where switches may be needed are:
    * Failed switches that still have NEED_SWITCH set
    * If a thread is blocked waiting for a switch.

References #1305
Tweak the LSM cursor enter loop slightly.

It makes more sense to me if we push the work unit to trigger the switch then wait...
Fix the switch logic so we set WT_LSM_TREE_NEED_SWITCH when there is no primary.
Merge pull request #1308 from wiredtiger/lsm-switch-compact

Ensure that there are switch work units for LSM trees that need them.
LSM cursors need to resolve key/value buffers before calling __clsm_enter.  Otherwise, we can end up with the LSM cursor value pointing at a buffer in a closed cursor, which we then try to copy.

refs #1306
Add statistics to track open sessions and the range of transaction IDs that are pinned.
Close chunk cursors on LSM reset, so that nothing stays pinned in cache.
Forcefully discard a tree from cache if doing a forced drop.
../src/lsm/lsm_cursor.c:115:13: variable 'c' set but not used
whitespace
Whenever we verify an address when running with HAVE_DIAGNOSTIC, confirm
it doesn't appear on allocation/discard lists as well as that it's part
of the file. Reference #1245.
Show the LSM cache size problem as MB, not just B, it's easier to work with.
I always forget format doesn't allow you to specify the cache size as "8gb"
or something like that, complain if the numeric configuration isn't a number.
Crank up the possible cache size to 100GB.
Don't leave the LSM tree locked on error.

References #1311
Split the condition variable and read/write lock code into separate
files, prepare for a non-POSIX implementation of read/write locks.
Prefix the WT_ATOMIC_XXX macros with underscores, it's a mistake for
code outside of those include files to use them.
Don't jump out of __curlog_close early, accumulate errors instead.
Clean up comments, there are non-POSIX implementations now.
Replace the POSIX read/write lock code with our own implementation so
we can unlock any lock from any thread, reference #1277.