rtph264pay/rtph265pay: Fix use after free

We can't assume a buffer that has been pushed in the adapter is still
valid. This fixes a use after free detect when running test on jenkins.
6 jobs for rtph265pay-fix-use-after-free in 26 minutes and 33 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  Preparation
passed #67869
gst indent

00:00:27

passed #67868
manifest

00:00:21

 
  Build
passed #67870
build fedora x86_64

00:02:54

 
  Test
passed #67871
check fedora

00:15:38

 
  Full Builds
passed #67872
build android arm64 api28

00:03:45

passed #67873
build cerbero fedora x86_64

00:07:31