work queue: make trace related code compile aware

This patches removes trace code if trace is not enabled. Based on Hitoshi Mitake
original patch:

- lib, sheep: exclude stuff for tracing when it is not enabled

Reviewed-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>