Fix for empty flamegraph on linux
Fix for empty flamegraph on linux

**Problem**

This fixes the sypmtoms of issue #41 on Fedora 24 (and potential other
distros).
The `perf script` command is being executed too soon before the `perf
record` command finishes writing its contents to the tmp perf file.
As a result, the `perf script` command fails with an error.

**Before**

```
$ DEBUG=0x,0x:stack-convert 0x --trace-info index.js
Profiling^C[ perf record: Woken up 8 times to write data ]
  0x Caught SIGINT, generating flamegraph +0ms
Caught SIGINT, generating flamegraph WARNING: The /tmp/perf-3ns4rp.data
file's data size field is 0 which is unexpected.
Was the 'perf record' command properly terminated?
  0x begin rendering +48ms
  0x:stack-convert serializing samples +4ms
  0x:stack-convert samples serialized +1ms
  0x converted stacks to intermediate format +0ms
[ perf record: Captured and wrote 2.117 MB /tmp/perf-3ns4rp.data (5423
samples) ]
  0x flamegraph generated +297ms
  0x tidying up +0ms
file:///home/dmartin/nodeconfeu2016/slow-rest-api/profile-13531/flamegraph.html

  0x exiting +0ms
  0x done rendering +0ms
```

**After**

```
$ DEBUG=0x,0x:stack-convert 0x --trace-info index.js
0x captures stacks using perf, which requires sudo access
Profiling^C[ perf record: Woken up 9 times to write data ]
  0x Caught SIGINT, generating flamegraph +0ms
Caught SIGINT, generating flamegraph [ perf record: Captured and wrote
2.124 MB /tmp/perf-2tsfmz.data (5435 samples) ]
[vdso] with build id cd24458eaca84d42b76906559c1e564f1ad2222f not found,
continuing without symbols
  0x begin rendering +1s
  0x:stack-convert serializing samples +7s
  0x:stack-convert samples serialized +5ms
  0x converted stacks to intermediate format +0ms
  0x flamegraph generated +795ms
  0x tidying up +1ms
file:///home/dmartin/nodeconfeu2016/slow-rest-api/profile-15487/flamegraph.html

  0x exiting +0ms
  0x done rendering +0ms
```

davidmarkclements/0x