Add NewThreadTime event and fix several bugs in memory state handling.

NewThreadTime is used to create a new block in a thread's trace, with a new
thread time, without changing the active instruction. This can be used if one
instruction makes several discrete changes (we will use this for intercepted
function calls that make discrete changes, e.g. qsort).

In MemoryState::memcpy():
 - Fix a bug where a block's end address was set to its size.
 - Fix a bug where blocks were "copied" to the source address (rather than the
   destination).

In ThreadState::restoreMemoryState() for StateMemmove (line 154):
 - Use lower_bound to find the start of the copying range, in case there is
   no fragment at the start of the copy area.

In ThreadState::restoreMemoryState() for StateMemmove (line 195):
 - Use lower_bound to find the start of the copying range, in case there is
   no fragment at the start of the copy area.

In ThreadState::restoreMemoryState() (line 275):
 - Restore global variable data states to the Memory parameter, rather than the
   ProcessState's memory.