gi: support invoking with GVL unlock

CAUTION: This change breaks internal API compatibility. Libraries that
use "invoke" should be changed.