CAS-14759: Restore pbmask for cube standard gridder via `calcmask`
The previous performance optimization for the cube standard gridder
bypassed normalizeprimarybeam() on the master node to avoid a slow,
sequential plane-by-plane evaluation. However, this inadvertently skipped
the generation of the `mask0` subtable on the `.pb` image, causing the
pbmask to be missing from the dirty map.
This commit restores the mask creation on the master node by using
the `ia.calcmask()` tool. This preserves the majority
performance gain from the previous optimization while correctly restoring
the `pblimit`-based mask for downstream application.
Additional optimizations:
- Mask generation is skipped entirely if `pblimit < 0.0`, aligning with tclean logic
- Cleaned up redundant imports inside the makePB function
- Handled tool lifecycle with an explicit `_ia.done()` for safe memory management
Pull request #1043: CAS-14606
Merge in CASA/casa6 from CAS-14606 to master
* commit 'e2af0ec57f50d3edffed7dd5384465472326b4a5':
Add a check that an entire (sub-)table is empty (nrows=0)
Fix a bug in is_column_empty function and add tb.getvarcol-based data existence check for the subtables
Add test for data types, str, int, float
Access the first row only
Use tb.getvarcol to check if optional data columns in Main table have any data instead of tb.getcell