Call Task::rbc_count() to read rbc instead of reading the performance counter directly.

This avoids spurious failures if something has already read and cleared
the hardware rbc counter.
Pass exit code to terminate_recording() and call it when we terminate due to rbc not working.
Fall back to PTRACE_GETFPXREGS when XSAVE is not supported.

Resolves #1282.