Emulate touch() for backends that don't support it

Backport of 9738fae3cf1ad18593d21eb62e138e00c01f5f36