Droped onFlush event in favour of kernel.terminate event.

This makes it possible to process the Solr tasks in the background after the
response has been sent to the client.

- Fixed test cases.
- Added note to documentation.