lua : fix bug #9682

we properly release the lua lock and take the gtk lock
when updating the selection