Fix invalid write to memory issue in A2DP module
Fix invalid write to memory issue in A2DP module

Under some circumstances (such as terminating bluetoothd during music is
streamed) sep object may be destroyed (memory for sep object is internally
freed, directly by "a2dp_unregister_sep") after invoking
"media_endpoint_clear_configuration" (in "stream_state_changed").
It leads to invalid write issue (reported by valgrind) after assignment
"sep->stream = NULL", since "sep" is "alias" pointer to sep object which
is already out of date (memory for sep object has been already freed)

This patch prevents from this issue by ensuring that assignment
"sep->stream = NULL" would be executed when sep object certainly exists.

ComputeCycles/bluez,ComputeCycles/bluez,ComputeCycles/bluez,mapfau/bluez,mapfau/bluez,silent-snowman/bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,mapfau/bluez,pkarasev3/bluez,ComputeCycles/bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,pkarasev3/bluez,silent-snowman/bluez,mapfau/bluez,pkarasev3/bluez,pstglia/external-bluetooth-bluez,silent-snowman/bluez,pstglia/external-bluetooth-bluez