Drones could be used to smuggle guns into jails and airlift escaping prisoners, a union warned, after they were branded a threat to national security.