sdm: Use Sys wrapper for dup() call

Add function pointer for dup() in Sys wrapper and call it instead of
calling system calls.

Change-Id: Ia18edfd84ac1b64cc32f01a868ee9d71406a427b
diff --git a/sdm/include/utils/sys.h b/sdm/include/utils/sys.h
index 0a90fc1..dc45696 100644
--- a/sdm/include/utils/sys.h
+++ b/sdm/include/utils/sys.h
@@ -45,6 +45,7 @@
   typedef int (*fclose)(FILE* fileptr);
   typedef ssize_t (*getline)(char **lineptr, size_t *linelen, FILE *stream);
   typedef int (*pthread_cancel)(pthread_t thread);
+  typedef int (*dup)(int fd);
 
   static ioctl ioctl_;
   static open open_;
@@ -56,6 +57,7 @@
   static fclose fclose_;
   static getline getline_;
   static pthread_cancel pthread_cancel_;
+  static dup dup_;
 };
 
 }  // namespace sdm