FIXFOR: Remove vfs_path_to_str() function for avoid often memory allocations.
(vfs_get_encoding): optimization and enhancement:

  * get rid of extra memory duplication;
  * support of recursive search of correct encoding;
  * add tests.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>