U.N. finalises treaty on terrorist funding