Correctly handle dup() failure in Parcel::readNativeHandle

bail out if dup() fails, instead of creating an invalid native_handle_t

Bug: 28395952

Change-Id: Ia1a6198c0f45165b9c6a55a803e5f64d8afa0572

const void* Parcel::readInplace(size_t len) const
{
 if (len > INT32_MAX) {
 return NULL;
 }

 if ((mDataPos+pad_size(len)) >= mDataPos && (mDataPos+pad_size(len)) <= mDataSize
 && len <= pad_size(len)) {
 const void* data = mData+mDataPos;
        mDataPos += pad_size(len);
        ALOGV("readInplace Setting data pos of %p to %zu", this, mDataPos);
 return data;
 }
 return NULL;
}

const void* Parcel::readInplace(size_t len) const
{
 if (len > INT32_MAX) {
 return NULL;
 }

 if ((mDataPos+pad_size(len)) >= mDataPos && (mDataPos+pad_size(len)) <= mDataSize
 && len <= pad_size(len)) {
 const void* data = mData+mDataPos;
        mDataPos += pad_size(len);
        ALOGV("readInplace Setting data pos of %p to %zu", this, mDataPos);
 return data;
 }
 return NULL;
}
