Ii would say you only tell people who you'd be comfortable with if things went wrong.

Last pg we told more people earlier than we would have normally - it was a shock and telling people was a way of coping. Plus a few close friends were in town for DH's 40th birthday and it just slipped out (plus they wondered why I wasn't drinking at the party, none of the usual excuses applied). I ended up telling some people at work around 9-10 weeks, and then we found out at the 12 week scan that the baby had died. Although I wished that a few less people knew, it was also quite good as I didn't have to pretend everything was OK.