Alter NewTraceWriter to return a pointer so mutex is not passed by value

Go vet was complaining that traceWriter's mutex was being passed by value. As per @Zariel's suggestion, I modified NewTraceWriter to return a pointer rather than a struct by value.