Fixed sending on exit in Mac port

The backgroundQueue was not being completely flushed on exit on MacOSX
so now we tell it to complete all operations.