Fixes bio{snoop,top} on 4.10.

This commit fixes #888.  The 2 scripts run the same check, and now run
basically the same code to do it.

Tested on 4.10-rc2.
diff --git a/tools/biosnoop.py b/tools/biosnoop.py
index bed6ded..aa8a077 100755
--- a/tools/biosnoop.py
+++ b/tools/biosnoop.py
@@ -106,14 +106,12 @@
  * test, and maintenance burden.
  */
 #ifdef REQ_WRITE
-if (req->cmd_flags & REQ_WRITE) {
+    data.rwflag = !!(req->cmd_flags & REQ_WRITE);
+#elif defined(REQ_OP_SHIFT)
+    data.rwflag = !!((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE);
 #else
-if ((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE) {
+    data.rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);
 #endif
-        data.rwflag = 1;
-    } else {
-        data.rwflag = 0;
-    }
 
     events.perf_submit(ctx, &data, sizeof(data));
     start.delete(&req);