Updated OSM sync script to send an email on error

Also, the script is smarter about syncing, it won't try to sync 10 times if it succeeds right away.