Family dog saves man's life while he was sleeping