No officer shall be liable for obeying any final order discharging or directing the discharge of any prisoner.