run writer in a separate goroutine