tmpfs: optimize clearing when writing