Allow to override layout in res.locals

I could be missing something but ... the `typeof` operator always returns a string so `typeof res.locals.layout !== undefined` will _always_ be true.

I think you probably meant `typeof res.locals.layout !== 'undefined'` (using `!=` will be okay as well in that particular case).