Only flush TCP connections, not serial ones (fix #402)