Man says he shot pit bull that tried to attack him