Check locking first on set_current_vlan

Change-Id: Ib431d4858c24e1cd90248b9afc1fd1ebb482828c
diff --git a/util.py b/util.py
index 714b3c4..35c3bb2 100644
--- a/util.py
+++ b/util.py
@@ -517,10 +517,10 @@
         port = db.get_port_by_id(port_id)
         if port is None:
             raise InputError("Port ID %d does not exist" % port_id)
-        if port.is_trunk:
-            raise InputError("Port ID %d is not an access port" % port_id)
         if port.is_locked:
             raise InputError("Port ID %d is locked" % port_id)
+        if port.is_trunk:
+            raise InputError("Port ID %d is not an access port" % port_id)
 
         vlan = db.get_vlan_by_id(vlan_id)
         if vlan is None: