extmod: Add ubinascii.unhexlify

This also pulls out hex_digit from py/lexer.c and makes unichar_hex_digit
diff --git a/py/unicode.c b/py/unicode.c
index db4aa43..63e9601 100644
--- a/py/unicode.c
+++ b/py/unicode.c
@@ -169,3 +169,13 @@
     }
     return c;
 }
+
+mp_uint_t unichar_xdigit_value(unichar c) {
+    // c is assumed to be hex digit
+    mp_uint_t n = c - '0';
+    if (n > 9) {
+        n &= ~('a' - 'A');
+        n -= ('A' - ('9' + 1));
+    }
+    return n;
+}