So I assume your Keyboard is not USB as it does not show on the list and you are using the midi port.
One thing that's a very low buffer setting, on my system I would experience drop outs at that low a setting.
While trouble shooting I would open Mix Control and set the buffer in the middle.
Un check the Microsoft Wavetable in midi outputs and choose nothing if your not using your midi output. This will allow Sonar to automatically load TTS-1 when you open a MIDI file and saves time.
I see nothing else that would explain midi latency. Possibly a setting in the keyboard itself?