timeline: Fix possible NULL dereferences when getting the closest RAP.
timeline: Fix possible NULL dereferences when copying timeline map.