[proflog] Add counters support to proflog

Add support for counters sampling inside in the log profiler. As discussed with Paolo, it was decided to integrate the code directly in proflog.c instead of having it in a separate file which needed to export some functions (such as emit_... and ensure_logbuff).

This work in the log profiler depends on changes in the counters API which have been submitted in https://github.com/mono/mono/pull/992 and in https://github.com/mono/mono/pull/1022