Fix for Pin or key missing rfcomm socket error

If cancel is pressed on the pin request dialog (for non SSP case),
auth request continues in a loop. Add additional checks for
the auth agent.

This is a gross temporary hack till we move to the mgmt interface.

Change-Id: I565a75698cb4fa1c2ed8c93ed6198b05a1a7b8af
diff --git a/src/device.c b/src/device.c
old mode 100644
new mode 100755
index 8805c27..8728644
--- a/src/device.c
+++ b/src/device.c
@@ -2146,10 +2146,12 @@
 	if (auth && auth->type == AUTH_TYPE_NOTIFY && auth->agent)
-	if (status == 0x06) {
+	// Temporary hack till we move to mgmt interface.
+	if (status == 0x06 && auth == NULL) {
 		device_get_address(device, &bdaddr);
 		btd_adapter_retry_authentication(device->adapter, &bdaddr);
+		return;
 	} else if (status) {
 		device_cancel_authentication(device, TRUE);
 		device_cancel_bonding(device, status);