Add NULL checks for InstallerMedia.os_media

Check if InstallerMedia.os_media is non-null before using it, otherwise
we get a crash if its NULL.