Back porting Denis Pravdin changes to CPU Profiling code.

This is a back port of changes that Denis @dp7 are currently pushing to the upstream. This change ensures blink tests are passing as well as crosswalk ones. Also it fixes 24 _debug_ v8 tests currently failing with segfault.

Please note that although almost the same changes are being pushed to the upstream we still need this separate patch because it may take significant amount of time to put the changes into upstream and then back to crosswalk branch.