Single-domain Generalization in Medical Image Segmentation via Test-time Adaptation from Shape Dictionary