Consistently use APP_WRITER as an integer, never as a nullptr

(not that it matters much in practice, on platforms where nullptr is all-zero
anyway)

Change-Id: I640e4e3e8c77f8c5c59c8e4b51c04f72dc1fadf9