Update native.c

Fix for generating object_id in ascending order. 
Previously it is failing for finding last and first record.