1. fix a bug caused by client_get_filepath, which uses
   an static local variable as return value; that is,
   client_get_filename() is not thread_safe.
2. know more about thread_safe function, or reentrant function.