Backport Emacs HEAD's fullscreen mode option

This makes it possible to bypass OS X's fullscreen mode.  The changes
were pulled from Emacs's bzr repository with minimal changes to get
them to work with 24.3