trace: Move parameter unwraping out of traceFunctionImplBody/implementWrapperInterfaceMethodBody.

Should make no difference by itself, but it is more useful like that, and
is needed by follow-on changes.
dxgitrace: Track D3D11 maps per ID3D11DeviceContext.

Instead of per-ID3D11Resource.

Because applications (e.g., 3DMark 2013) can concurrently map the same
resource on a different thread via a deferred context.  Mappings done
by different device contexts will have different pointers.
d3dretrace: Track maps per ID3D11DeviceContext.

Also cleanup/compact code a bit.