Use Asterisk's temporary directory instead of /tmp

Also update to stop in case time can't be set; this causes the script to be re-executed immediately by Asterisk and starts a loop