Ensure handle still open before emitting listening, fixes #7834

Signed-off-by: Eli Skeggs <skeggse@gmail.com>