Detection of atrial fibrillation via pacemaker threshold scanning