Stability improvement

This is a follow-up to [7601](https://github.com/gitlabhq/gitlabhq/pull/7601). I'm not sure if there's a possibility of such case, but anyway...
I am not sure also. My concern was that URI ctor would throw in case of invalid URI. It seems that invalid URI is handled elsewhere, though. I'll remove rescue, if you still think it's not needed here.