Refactor flush event emitting in lib/RedshiftBulkInsert.js