drreg double-restoring for unreserved registers before and after barrier
When using the drreg "barrier" routines drreg_get_app_value(), drreg_restore_app_values(), and drreg_restore_app_aflags() with unreserved registers, drreg can end up double-restoring.
Here I insert instrumentation A, unreserve A's registers, restore A's registers to app values, and then sometimes insert instrumentation B, all before the next app instr.
In cases where there is no B we have a back-to-back restore:
+114 m4 @0x0000563685ca7f58 65 48 8b 0c 25 18 00 mov %gs:0x18[8byte] -> %rcx
00 00
+123 m4 @0x0000563685cb7880 65 48 8b 14 25 10 00 mov %gs:0x10[8byte] -> %rdx
00 00
+132 m4 @0x0000563685cb70b8 3c 81 cmp %al $0x81
+134 m4 @0x0000563685ca7d48 9e sahf %ah
+135 m4 @0x0000563685cb7220 3c 81 cmp %al $0x81
+137 m4 @0x0000563685cb7a78 9e sahf %ah
+138 m4 @0x0000563685cb7a18 65 48 a1 98 00 00 00 mov %gs:0x00000098[8byte] -> %rax
00 00 00 00
+149 m4 @0x0000563685cb75f8 65 48 8b 0c 25 18 00 mov %gs:0x18[8byte] -> %rcx
00 00
+158 m4 @0x0000563685cb74c0 65 48 8b 14 25 10 00 mov %gs:0x10[8byte] -> %rdx
00 00
When there is B, there's an extra restore after B.
drreg should mark native=true and give up the TLS slot on a get-app barrier call when the reg/aflags is unreserved to avoid this double-restore.