Trehalose dehydration under confined conditions