Just installed a new chain but it took me 4 tries, is it safe?
You should never break the chain at the connecting pin. Once a connecting pin is in there, it should not be removed. 

Removing a regular rivet enlarges the holes in the chain plates slightly. A connecting pin has a slightly greater diameter than a regular rivet so it fits properly. When you push out the connecting pin the holes get enlarged slightly again, so now a new connecting ping is slightly too small. 

So you have weakened the chain and run a increased risk of breaking it. You'll have to decide if you want to take on that risk. Personally, I would fix the chain for peace of mind. 

If you want to fix it you have a couple of choices:


Replace the damaged chain links with new links from the small length of chain left over when you shortened the new chain, using two new connecting pins, and being extra careful to not screw it up this time.
Replace the damaged outer chain links with a Shimano Quick Link. Beware that most quick links are one-time use so make sure the chain is routed properly before completing installation. 


I recommend #2

BTW, if you threaded the chain through the derailleur cage incorrectly, you can remove one cage side plate instead of re-breaking the chain.