The Liberal Democrats will cancel the result of the EU referendum if elected in the next general election.