Profiler additions

- Added a lock to the statistics to prevent crash in multi threaded
regions
- Added the ability to discard a region