Add MSG_TERMINATE message to handle client disconnect.