Labour is set to commit to giving full voting rights to foreign nationals living in the UK in a move that could have a seismic impact on a future Brexit referendum.