fix default-directory on Cocoa and Mavericks

On Mavericks, default-directory is `/` when open Emacs.app.
It should be home directory.

Patches from emacs trunk revision 114730 and revision 114882.