Boris Johnson's majority in parliament hangs by a thread after the Conservatives lost the Brecon and Radnorshire by-election.