LeBron James to leave Lakers as free agent