Bluetooth: Cleaning up pan_conn DB, if connection is not successful. - do not merge

A case where DUT is paired with remoteDeviceA &  remoteDeviceB.
remoteDeviceA is not pagable(turned off or some other reason).
DUT(PANU) try to connect remoteDeviceA(NAP). But connection is
unsuccessful, Because remoteDeviceA is not pagable, In this scenario
btpan_conn Database is not cleaning up at btif layer. Later
remoteDeviceB(PANU) connect to DUT(NAP) & connection is succesful,
When remoteDeviceB disconnect existing connection. As database
still has remoteDeviceA BD address at Btif layer. remoteDeviceA
BD address is passed instead of remoteDeviceB BD address from Btif
to UI. So remoteDeviceB still shows connected on UI. Cleaning up
pan_conn database for particular pan connection at BTIF layer,
whichever connection is not successful will solve this issue.

Change-Id: I31dfe3ef46295e74bbfb57563e4fd4fc7155f006
diff --git a/btif/src/btif_pan.c b/btif/src/btif_pan.c
index 088c609..ae395ba 100644
--- a/btif/src/btif_pan.c
+++ b/btif/src/btif_pan.c
@@ -617,6 +617,9 @@
                 /*         p_data->open.bd_addr[3], p_data->open.bd_addr[4], p_data->open.bd_addr[5]); */
                 btpan_connection_state_t state;
                 bt_status_t status;
+                btpan_conn_t *conn = btpan_find_conn_handle(p_data->open.handle);
+
+                ALOGV("%s pan connection open status: %d", __func__, p_data->open.status);
                 if(p_data->open.status == BTA_PAN_SUCCESS)
                 {
                     state = BTPAN_STATE_CONNECTED;
@@ -626,8 +629,8 @@
                 {
                     state = BTPAN_STATE_DISCONNECTED;
                     status = BT_STATUS_FAIL;
+                    btpan_cleanup_conn(conn);
                 }
-                btpan_conn_t* conn = btpan_find_conn_handle(p_data->open.handle);
                 /* debug("BTA_PAN_OPEN_EVT handle:%d, conn:%p",  p_data->open.handle, conn); */
                 /* debug("conn bta local_role:%d, bta remote role:%d", conn->local_role, conn->remote_role); */
                 int btpan_conn_local_role = bta_role_to_btpan(p_data->open.local_role);