Controller::referer() and local URL

Resolves https://github.com/cakephp/cakephp/issues/3394