Liverpool are closing in on a deal to sign Spanish midfielder Thiago Alcantara from Bayern Munich for £27m.