implement robust mutex support

This allows making everything in shared memory robust to
processes dying at any point in time (not actually done yet in this
commit).

This includes using FUTEX_REQUEUE_PI, but currently only on ARM because
that's the only place we can rely on the kernel not corrupting random
memory due to a bug (fix has been merged upstream).

Change-Id: Id5bda1dc3185a1aac759510934bce6fd9121ad3f
diff --git a/aos/common/mutex.cc b/aos/common/mutex.cc
index c5b8652..eed5b0b 100644
--- a/aos/common/mutex.cc
+++ b/aos/common/mutex.cc
@@ -28,6 +28,8 @@
   const int ret = mutex_grab(&impl_);
   if (ret == 0) {
     return false;
+  } else if (ret == 1) {
+    return true;
   } else {
     LOG(FATAL, "mutex_grab(%p(=%" PRIu32 ")) failed with %d\n",
         &impl_, impl_.futex, ret);
@@ -43,6 +45,8 @@
   switch (ret) {
     case 0:
       return State::kLocked;
+    case 1:
+      return State::kOwnerDied;
     case 4:
       return State::kLockFailed;
     default: