Added check_arguments to trace.cpp

* Before doing contact tracing, arguments are checked using
  check_arguments

* Arguments to buildContactsLookup have been changed from SEXP to
  integer pointers