profile: Introduce profile decorator

The profile decorator can be used for profiling certain code path, where
whole application profile is not needed.

To profile a function, decorate it:

    from profile import profile
    import slowmodule
    ...
    @profile('expensive_stuff.prof')
    def test_expensive_stuff():
        slowmodule.do_expensive_stuff()

The recorded profile will include all threads running or started while
my_function was executed.

Note that you cannot use application wide profile and function profile
in the same time. To prevent confusion, a profile.Error is raised if you
try to start a profile while the profiler is already running.

Change-Id: I2bc861832bbbda67937b5663f6cfbc1a54bfbf7d
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/27389
Reviewed-by: Antoni Segura Puimedon <asegurap@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>