refcnt_realloc(): improve error handling
refcnt_realloc(): improve error handling

Check if pointer is valid.
Return NULL instead of new object when reallocating locked (shared) object.

ShiftMediaProject/libbluray,ShiftMediaProject/libbluray,ShiftMediaProject/libbluray,ShiftMediaProject/libbluray