Re #9355. Move computation of what output filename will be.

Putting it before the algorithm call gives us a better chance of getting
it right if the algorithm runs over midnight.
Use cal file name from CalibrateRectangularDetectors. Refs #9355.
Merge remote-tracking branch 'origin/bugfix/9355_calibraterectangulardetectors_date'