You have been lucky not to have been caught with an extension cord. If they do see it in your carry-on luggage as it goes through x-ray, they will probably take it. Even in your check luggage it may be confiscated. Much easier to request one from Special needs ahead of time and have it in your state room waiting for you and not risk having your luggage delayed.