After hitting ESC (or cmd + C on my computer) you must hit : for the command prompt to appear. Then, you may enter quit.
You may find that the machine will not allow you to quit because your information hasn't been saved. If you'd like to quit anyway, enter ! directly after the quit (i.e. :quit!).