fix more issues and add test

1) Add test for caching and calculation of dependent post-aggs for
TimeSeries and TopN
2) Fix more NPEs while calculating dependent postAggs, passing
baseHolder was wrong as it does not contain post-aggs during computing
dependent ones.