Init $g_display_errors with dev settings on localhost

When the server name is localhost/127.0.0.1, we automatically set
$g_display_error to the recommended development values, i.e.

 - E_USER_ERROR   => DISPLAY_ERROR_HALT
 - E_WARNING      => DISPLAY_ERROR_HALT
 - E_ALL          => DISPLAY_ERROR_INLINE

Issue #17501