[FIX] addons: incorrect new-api invocation of method write() with context

This fixes #3411.