chainntnfs/btcdnotify: fix race condition for block epoch clients
chainntnfs/btcdnotify: fix race condition for block epoch clients

This commit fixes a race condition that was introduced while fixing a
lingering bug in the logic to notify block epoch clients. The race
condition would happen as by removing the default case in the select
statement, it was now possible for the client’s block epoch client to
be closed while the routine was attempting a send on it.

We now eliminate this race condition possibility by adding a wait group
to all goroutines launched to dispatch a block epoch notification. With
this modification, the Stop() goroutine will now wait for all other
goroutine to exit before closing the block epoch channels of all
currently registered clients.

ddustin/lnd,aakselrod/lnd,LightningNetwork/lnd,ddustin/lnd,LightningNetwork/lnd,aakselrod/lnd,AndrewSamokhvalov/lnd,AndrewSamokhvalov/lnd