When exporting an H.264 video, why is the resulting file's extension .avi?
H.264 is a codec and MP4 is a file format. An H.264 stream can be contained in several different file formats, e.g. AVI, MP4 or MKV, and most file formats can handle several codecs.  

Video file formats, such as AVI, MP4 or MKV, can handle multiple streams, and most commonly contain one video stream, one or more audio stream(s) and possibly one or more subtitle stream(s).  

Simply renaming an AVI file to MP4 won't make it an MP4 file, though most players will detact the actual format and ignore the filename extension. To convert an AVI to MP4, you'll need to re-multiplex it. Multiplexing is the process of combining the different streams into one file and write the proper metadata. This can be done without re-encoding the streams.  

I just had a quick look, and I can't find an option to save as MP4, and unless someone has a solution for that, it looks like you'll need an external program for this. If you need/want a GUI application, Avidemux will do nicely for simple re-multiplexing and even some filtering and re-encoding. If you're OK with commandline programs, I recommend FFmpeg.