fix applescript error

fix applescript error when Terminal is runing and window count is 0
see https://github.com/afterdesign/MacTerminal/issues/24