add transaction unit test and fix bugs 

this pull request adds unit tests to transaction package and fix bugs found in test

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/intel-hadoop/gearpump/172)
<!-- Reviewable:end -->