Is it safe to have a POE switch in an attic?
I don't know for sure, but I don't think it's a good idea to have something that CAN overheat in an area that you don't normally visit (i.e. attic)  Cables runs of Cat 5 and Cat 6 should be fine at any length in a house unless you have a mansion or are running parallel to power.  I believe up to 200 foot is okay before any loss in packets.

POE switches are typically safe, and a good quality one is definitely worth it if you plan on leaving it unattended.  Extension cords for permanent use is never a good idea, but a 12 or 14 gauge cord would be plenty overkill and should NEVER get hot with a low power drawing POE switch on the cord.  Obviously don't use a lamp cord for extension purposes.