add 'check that failure is properly returned' test to examples/memread and examples/memread_4m