You should be able to just add it to the post object before you put it into the $postids
array:
$postids = array();
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
$the_query->post->post_permalink = get_permalink();
$postids[] = $the_query->post;
}
}