Fixfor fx 116

Reworked message batching once again, moved part of batching logic to writer so it can do it under lock.
Has unexpected session_test compile error... that _conection->write_batch is not found...