d3dretrace: Replay IUnknown::AddRef/Release methods faithfully.

Several D3D APIs (especially recent ones) keep track of reference counts
and will ensure errors if reference counting is not properly done.

For example, IDXGISwapChain::ResizeBuffers will fail if there are
outstanding references to its buffers.
d3dretrace: Cope with _MAP_FLAG_DO_NOT_WAIT flags.

If the map succeeded in the original trace, then we must wait.