Graceful shutdown support

Interval cleanup after socket close.