L2CAP socket: Stop L2CAP server by ID instead of PSM

* There could be multiple L2CAP socket control blocks with the same PSM
* The unique identifier for a L2CAP socket control block should be the
  unique ID allocated during control block initialization
* Use this ID to track L2CAP socket control block instead of PSM ensure
  that we close the correct socket
* Reset GAP handle and L2CAP socket ID to 0 when calling
  bta_jv_free_l2c_cb() so that disconnected L2CAP control blocks does
  not count

Test: CtsVerifier
Bug: 147997447
Bug: 144148429
Change-Id: Ideb428bc73aa0b36b8deb20fac280e44c8fe7db1
(cherry picked from commit ad23e6b2f473829b1819918cd3f927d1134c83b3)
diff --git a/bta/jv/bta_jv_act.cc b/bta/jv/bta_jv_act.cc
index 462ee9d..2ede5c9 100644
--- a/bta/jv/bta_jv_act.cc
+++ b/bta/jv/bta_jv_act.cc
@@ -362,6 +362,8 @@
   p_cb->cong = false;
   bta_jv_free_sec_id(&p_cb->sec_id);
   p_cb->p_cback = NULL;
+  p_cb->handle = 0;
+  p_cb->l2cap_socket_id = 0;
   return status;
 }
 
@@ -1121,7 +1123,7 @@
 /* stops an L2CAP server */
 void bta_jv_l2cap_stop_server(uint16_t local_psm, uint32_t l2cap_socket_id) {
   for (int i = 0; i < BTA_JV_MAX_L2C_CONN; i++) {
-    if (bta_jv_cb.l2c_cb[i].psm == local_psm) {
+    if (bta_jv_cb.l2c_cb[i].l2cap_socket_id == l2cap_socket_id) {
       tBTA_JV_L2C_CB* p_cb = &bta_jv_cb.l2c_cb[i];
       tBTA_JV_L2CAP_CBACK* p_cback = p_cb->p_cback;
       tBTA_JV_L2CAP_CLOSE evt_data;