CheckMemoryLeak: use library while checking whitelist functions

The problem was in ignoring library functions while testing leaks in function arguments. Also there was another `test_white_list` calls, I'm not sure they all should be replaced or not. I kept old `test_white_list` for tests.

Take a look at tests to see difference.

P.S. Maybe passing settings is redundant but `test_white_list` is static and settings is private.