add write-on-close test from Unicorn