Add support for multithreaded code profiling.
So far profiler relies on a big lock to ensure that its data are not being overwritten while read.
Code is not directly implemented in the aspect to prevent a superfluous lib pthread dependency.