write.c: Fix handling of NULL context in stream_filtered()