tools lib api fs: Use str_error_r()