A Wrexham man who breached a restraining order against his ex-partner and her family has been jailed.