[BUGFIX] Avoid setting pid on record if zero or less

Since content elements are not allowed on page UID zero, it's as far as I can tell perfectly fine to just check if the pid is above zero before setting it, if there is no relative record (in which case the pid just comes from that record).