when you say "safe" to be having sex do you mean safe healthwise (no problems as far as i can see) or safe as in not getting PG? if you mean the latter, and you don't want to try again immediately, there is no safe time really, you could get pregnant, so if you do want to tr y again anytime would be ok. I know it's not the same but when i lost my daughter (stillborn at 27 weeks) i bled for about 3 weeks thena period 8 weeks after, then another 6 weeks before a period. When i lost my son this year, i bled for nearly 3 weeks, then a period weeks later and now nothing for six weeks.
There is "anecdotal" evidence that after you have had a pg or miscarriage, you are more likely to get pregnant again as your body now knows what to do. How true this is i don't know, but i was pg with my son after a month of trying, when it had taken me 9 years to concieve my daughter.