[vm] move pagedir update inside frame_alloc