Prevent to raise Errno::ENOTCONN if no client connected

Small refactoring

Change-Id: I500e3e30b5678b5ce126573cb3e2b360a490b155
Closes-Bug: #1290741
Stop frame listeners in any case

Change-Id: I0d7a75fd35a43446b23aed6745302919ccd73ae9
Closes-Bug: #1290755
Merge "Prevent to raise Errno::ENOTCONN if no client connected"
Merge "Stop frame listeners in any case"