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