Freeze-drying of pharmaceuticals