Use a special cross_thread_mutex_t to avoid thread switches in perfmon collection.
Minor change. Also, this currently dead-locks. Looks like we really need a cross-thread rw lock.
Made cross_thread_mutex recursive to avoid deadlock issue in perfmon collection.
Merge branch 'next' into daniel_1183_spinlock
Add missing -p flag to mkdir in npm-inc.sh

Review 1206 by @neumino
Refactored cross_thread_mutex
Merge branch 'daniel_1183_spinlock' into next
Merge branch 'next' into sam_alt

Conflicts:
	src/perfmon/core.cc
	src/perfmon/core.hpp