examples: merge: check read/write calls in copy_data()

Reported by: shaitan@