Singer and TV star Tulisa Contostavlos's trial over drugs allegations collapses as the judge accuses a prosecution witness of perjury.