bug fix: __tern_prog_end is not called for the main thread
bug fix: __tern_prog_end is not called for the main thread

reason: we used to hook __libc_start_main() and call __tern_prog_begin and
__tern_prog_end before and after user's main function.  However, if user's
main function calls exit(), the __tern_prog_end call will be skipped.

fix: hook the init_func and rtld_fini_func arguments to __libc_start_main
to call __tern_prog_begin and __tern_prog_end instead. rtld_fini_func will
be called even if user's main function calls exit().

hemingcui/xtern_with_paxos,columbia/xtern,columbia/xtern,columbia/xtern,hemingcui/xtern_with_paxos,hemingcui/xtern_with_paxos,columbia/xtern,hemingcui/xtern_with_paxos,columbia/xtern,columbia/xtern,hemingcui/xtern_with_paxos