py: Support conversion of bignum to bytes.

This gets int.to_bytes working for bignum, and also struct.pack with 'q'
and 'Q' args on 32-bit machines.

Addresses issue #1155.
diff --git a/py/objint_mpz.c b/py/objint_mpz.c
index 2746f4d..369e5af 100644
--- a/py/objint_mpz.c
+++ b/py/objint_mpz.c
@@ -104,6 +104,12 @@
     return mpz_hash(&self->mpz);
 }
 
+void mp_obj_int_to_bytes_impl(mp_obj_t self_in, bool big_endian, mp_uint_t len, byte *buf) {
+    assert(MP_OBJ_IS_TYPE(self_in, &mp_type_int));
+    mp_obj_int_t *self = self_in;
+    mpz_as_bytes(&self->mpz, big_endian, len, buf);
+}
+
 bool mp_obj_int_is_positive(mp_obj_t self_in) {
     if (MP_OBJ_IS_SMALL_INT(self_in)) {
         return MP_OBJ_SMALL_INT_VALUE(self_in) >= 0;