codegen: Do not use deprecated functions for lock statements
codegen: Do not use deprecated functions for lock statements

Fixes bug 662810.

spidermonkdust/vala,playya/vala,Distrotech/vala,rvu95/vala,frida/vala,frida/vala,severinh/vala,flobrosch/vala-fixes,spidermonkdust/vala,rvu95/vala,severinh/vala,Distrotech/vala,flobrosch/vala-fixes,severinh/vala,xdave/pvala,GNOME/vala,frida/vala,flobrosch/vala-fixes,Distrotech/vala,frida/vala,rvu95/vala,GNOME/vala,playya/vala,frida/vala,playya/vala,GNOME/vala,GNOME/vala,spidermonkdust/vala