A Ryanair flight bound for Dublin was forced to make a sudden emergency return to Porto following a potential security incident in the cockpit.