Add a signal handler for SIGUSR2.

Summary: For being able to notify (/waking) a sleeping daemon, a signal handler for the SIGUSR2 is added to the `DaemonOverseer`. This signal will be send to the child process which can implement a signal handler.

Test Plan: Put a PhutilDaemon (with a signal handler on SIGUSR2) to sleep for 10 minutes. Meanwhile, send a SIGURS2 to the daemon and see it being waked up.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran, richardvanvelzen

Differential Revision: https://secure.phabricator.com/D7676
Make it safe to call ExecFuture->resolveKill() after process resolution

Summary:
Fixes T4165. Currently, doing something like this is fine:

  $exec_future->resolve();
  $exec_future->resolve();

...but this isn't:

  $exec_future->resolve();
  $exec_future->resolveKill();

...and will raise garbage in the `resolveKill()` call. This is unhelpful, unexpected, and undesirable. Calling `resolve*()` multiple times is explicitly allowed, since it makes many patterns much easier to write and isn't sketchy or surprising or anything.

Check for an existing result before performing the kill.

Test Plan: Added a failing unit test and made it pass.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4165

Differential Revision: https://secure.phabricator.com/D7688
Speed up text markup for test results

Summary: Recently there are quite a few diffs hitting timeout when loaded in phabricator page. The reason is that those tests have huge amount of test results and it takes more than two minutes to finish rendering the user data part of the test results. And more than 90 percent of the time was spending on the shouldMergeBlocks calls. There is some unnecessary work in that function, especially first concatenate the lines and then split it using regex, which is a time killer.

Test Plan: Load D1071019. It has more than 15k test results and always times out before. Now it loads in about 5 seconds. Click on 'show all test results' seems to bring up all the test results in right format.

Reviewers: JoelB, lifeihuang, epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

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