apply the FileSystemEncoding when passing filename to FFI code

This fixes a crash when running addWatch on a FilePath that contains
characters not valid in the current encoding. For example, 'ü' is not
valid in the C locale.