when senders are all gone, use the correct method to close application.

Signed-off-by: Jianmin Zhou <toandrew@infthink.com>