[added to the 4.1 stable tree] tracing: Fix possible double free on failure of allocating trace buffer