Shape memory hermetic seal and threaded joint incorporating same