fix bug when test_fail is called via a do statement

test_fail used $0 as the filename instead of the filename reported by
caller. Under normal execution these would be the same but if the test
is executed by a do block then these would no longer be the same.