Avoid mutating params with invalid keys

Mutating `datum` in the idempotent middleware should not be a problem.
The problem occurs when invalid keys are passed, then tested by the calling code after the connection/request is made.
This should not be done, but we don't want to break existing code.

RE: #283