United Airlines has issued a stern warning to its pilots after mistakes in the cockpit put passenger planes in potential danger.