Ensure crate is compiled with std for panic handler

This CL adds a patch to use `extern crate std` to ensure that a panic
handler is available when the crate is compiled as a dylib.

Test: m libcast
Bug: 333887339
Change-Id: Ife3d34c32f99ec69d98370045f1b79a352be1601
diff --git a/patches/std.diff b/patches/std.diff
new file mode 100644
index 0000000..76f18e6
--- /dev/null
+++ b/patches/std.diff
@@ -0,0 +1,14 @@
+diff --git a/src/lib.rs b/src/lib.rs
+index f1db3fc..40d3c91 100644
+--- a/src/lib.rs
++++ b/src/lib.rs
+@@ -105,6 +105,9 @@ use std::error;
+ #[cfg(test)]
+ mod test;
+ 
++#[cfg(android_dylib)]
++extern crate std;
++
+ /// Cast errors
+ #[derive(Clone, Copy, Debug, Eq, PartialEq)]
+ pub enum Error {
diff --git a/src/lib.rs b/src/lib.rs
index f1db3fc..40d3c91 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -105,6 +105,9 @@
 #[cfg(test)]
 mod test;
 
+#[cfg(android_dylib)]
+extern crate std;
+
 /// Cast errors
 #[derive(Clone, Copy, Debug, Eq, PartialEq)]
 pub enum Error {