Wait for scheduled messages to complete on close.