Update email_to_sugar.php

Added to every select statent a check for deleted records. Database wise is != 1 slower then =0 check but for future proveness I tought it would be safer to check for not deleted as there may be in future a status 2 or 3 indicating some special states. Could be changed if there is a performance issue. Please check if there could be any problem by any query now returning no results any more in some cases.
I have tested the script but as some parts are only executed in certain circumstances I can't gurantee that all parts are working.
Cheers
Petr