A hacker involved in an attempt to blackmail Apple with a threat to delete 319 million iCloud accounts and factory reset millions of iPhones and iPads in 2017 has avoided going to prison after a London court handed down a two-year suspended sentence.