added end-of_batch flag to message, reworked session::send_batch

Please, review, accept. 
The unit test has to be done for batch sending. I've started it, but not completed since not yet familiar with UTs here. Please either remove it or finish. I've tested this by linking into my project and look for NOS messages in tcpdump (UT for that would be much better).
Added -lpthread to several makefiles since it did not link on my environment