re-order imports

like goimports would do.
Fix double unlocking

and also re-oder unlocks so that it will be easier to avoid errors.
Merge pull request #2 from nightlyone/remove_double_unlock

Remove double unlock