Improve error messages from Filesystem::readRandomBytes()

Summary: Fixes T4153. Primarily, raise a better error message on Windows. Also make the function a little stricter and a little better tested.

Test Plan: Unit tests.

Reviewers: btrahan, hach-que

Reviewed By: hach-que

CC: aran

Maniphest Tasks: T4153

Differential Revision: https://secure.phabricator.com/D7650
Improve the performance of phutil_loggable_string()

Summary:
Ref T4162.

  - Before doing anything character oriented, test if the whole string is fine to print as-is.
  - Reduce the number of calls to `string()`.

Test Plan: Saw cost drop on profiles.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4162

Differential Revision: https://secure.phabricator.com/D7656