I have reproduced this delay on my system, and it stems from some odd design choices in the D3D backend as well as keyboard handling. I have created a proof-of-concept set of changes to both to try to eliminate this lag as much as possible. It requires a lot more testing before I feel comfortable committing it to Allegro proper.
That said, attached is a version of the program in the OP with the changed Allegro alongside it, as well as the patch to Allegro (relative to 5.1) just so you can see what I did. I'm not sure it can get much better than that, but even going as far as I did has basically eliminated the lag for me. See if it does so on your system as well.
I should note, when you run speeder.exe you can pass in any argument to cause it to launch in fullscreen, if you want. Also, the allegro5.cfg alongside it can be used to force it into OpenGL mode.
The diff wasn't quite right. Fixed it.