cpp: added more Tsdb unit tests, fixed LevelTsdb bugs