The Gibraltar Supreme Court has ordered the release of seized Iranian tanker despite the last-minute US attempt to detain it.