Gunman opens fire on an Istanbul mosque just hours after terrorist was caught on CCTV stalking a nightclub