There were several improper uses of STL iterator/erase. Specifically, once
an iterator is erased, it is invalidated and may not be used again. Also,
erase advances the iterator, and so it was possible to skip over an element.
With --checkpoint-open-files we now restore the old working directory. This is
needed for MySQL, for example.
Correct comments and JASSERT around erase() method.
The function _initJassertOutputDevices() was calling fdopen(), which internally
allocates memory for the FILE stream. The memory was being allocated in the
user malloc arena. It can allocated memory between checkpoint/resume, 
which changes the memory structure in resume vs. restart.

We now use file descriptors instead of FILE streams to avoid this problem.
In jassert_safe_print(), setting the log file descriptor was a side effect of
the _initJassertOutputDevices() function. Moving that side effect to
jassert_safe_print() itself, and also adding a check to prevent initializing
the log file if DMTCP_TMPDIR has not been set yet.
Merging urdb branch into dmtcp-unstable branch.
Adding -DPTRACE to CFLAGS in Makefile, and fixing typo in mtcp_ptrace.c.
Adding a fix to handle the case where we are trying to open a connection to
a file that has been deleted.
Porting changes from stable revision 638.
Fix writeall in jassert.cpp. readall in mtcp_ptrace.c was bad name; Added comment
pthread_create bug fixed. Issue caused by the superior and inferior having
ptrace_pairs ordered differently.
Fixed REFILLED bug. The reason why we had never seen this before is because
of the "correct" location of the checkpoint thread (aka last position) and
because we only tested on dmtcp1, which had only one user thread. Thus the
checkpoint thread was the last one and what that means is that we attached
to it last. Now, since we have multiple threads and we needed a unique ordering
for the ptrace_pairs we started seeing the bug. The way we order the threads is
descendingly by superior tid, and then inferior tid. What that means is that we
started attaching to the ckpt thread before we attached to other threads. Thus
before sending the "i'm done" message to the coordinator.
The REFILLED bug was fixed for resume, but not for restart. This fixes it
for restart.
Porting a change from 32-bit to 64-bit code: if checkpoint on a breakpoint, 
do an extra singlestep just before exiting the signal handler.
dmtcp-unstable works now if we disable PTRACE.
- Change to make sure that the thread local variables in MTCP are accessed
  (resulting in memory allocation) as soon as a new thread is created.
- Usage of scandir was resulting in malloc which caused problems. Replacing
  scandir with open/readdir_r. Later we should get rid of readdir_r and use
  getdent systemcall directly.
Surrounded init_thread_local by #ifdef PTRACE.
- Part of rev 691
- Proper error number is displayed in case of some socket error.