Prevent overflows casting from double to short

This check is taken from HTS_Engine_save_generated_speech() 

https://github.com/zeehio/festival/blob/master/src/modules/hts_engine/HTS_engine.c#L641