A Leyland man who threatened to murder his ex-partner and her new boyfriend has been spared jail by a judge in Preston.