better condition for mapping_populate_iter
better exception for ser_get_string
keep obj reference to avoid GC in serializing for C ext

modify from c5aa8054bea417a350c970cd9b2c8acc8f5e2467, thanks to Leon