attrib: Run callback with the partial result of characteristic discovery

Callbacks should check for status equal to ATT_ECODE_ATTR_NOT_FOUND to
ensure that the characteristic discovery has finished.
unit: Add test for gatt_discover_char() (by UUID)
attrib: Reduce scope of variable declarations in char_discovered_cb()

This makes it easy to identify where variables are being used.