Add INVOKEVIRTUAL support to lockToSynchronized patch

Signed-off-by: Ross Allan <rallanpcl@gmail.com>