Tory MPs are in talks with Labour to prevent Britain leaving the European Union without a deal, John McDonnell has suggested.