Make profile and profile-thunk return the value of the profiled expression.

Closes PR14404.
Reorder profiler docs.