Fix occasional crash in the sampling profiler

Summary:
Before this commit, when the sampling profiler was finished, the main thread
would set a flag for the sampling thread to stop profiling but wouldn't wait for
the background thread to actually exit. This meant that the background thread
would sometimes add one last sample to the list of samples while we were in the
middle of processing that list. The Profile.results function makes two passes
over the list of samples and assumes that they'll be the same both times, so it
was crashing when the list got modified in the middle.

The fix is to wait for the sampling thread to exit before processing the
results.

Test Plan:
Temporarily put a sleep(1) just before the crash point and a sleep(.01) at the
top of the top of the sampling loop. With these sleeps, the home page
consistently crashes with sampling profiling enabled. Adding the join statement
fixes this crash.

Reviewers: ben

Reviewed By: ben

Subscribers: alpert

Differential Revision: http://phabricator.khanacademy.org/D7621