Liverpool struck seven minutes into stoppage time to beat relegation-threatened Nottingham Forest through Alexis Mac Allister.