In-line product quality control in freeze drying of pharmaceuticals