nir: Convert the NIR instruction insertion API to use cursors.