Fix return type inference for aggregate calls: consider number of items in GROUP BY clause

This fixes https://github.com/julianhyde/optiq/issues/231 (tested as `JdbcTest.testGroupByMax1IsNull`)

Side fixes:
  - alter min/max return type inference to ARG0_NULLABLE_IF_EMPTY (nullable when no keys in group by)
  - PushAggregateThroughUnionRule
  - ability to log final plan in Prepare
  - make emp.mgr nullable in `MockCatalogReader` (just to increase test coverage)