bugfix: dict will unref again when called lock/unlock twice

one instance may call lock / unlock more than one time

so, may be it's better to move unref dict to gc_lock