Bruno Guimaraes scored an injury-time winner as Newcastle United beat Leicester City 2-1 at St James' Park.