Flight LS178 declared an emergency as it flew across the Irish Sea before entering the skies above Dumfries and Galloway.