Bluetooth: L2CAP: Handle REJECT_RSP for ECRED

We can (and do) open multiple channels with a single L2CAP command. If the
remote doesn't support dynamic channels at all, then it sends back a
REJECT_RSP.

We only destroyed the first channel that matched the command PDU
identifier. Fix that and remove all channels that match.

Also add a test that verifies the patch.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
13 files changed