osd: Transaction use different iterator for different encode

When use_tbl is true, the tbl_iterator is used, while when use_tbl is
false the map_iterator is used.

A new class iterator_impl is used to hide the details of iterator.

Change-Id: I4d66de6de78c06572f0642f1d34aab6cfe699e75
Signed-off-by: Dong Yuan <yuandong1222@gmail.com>