Relative posts should never fail to build, even if @dir or @name is nil

Fixes https://github.com/jekyll/jekyll/issues/1963
DRY up code, props @tamouse
Give File.join the strings from the array
Merge pull request #1976 from jekyll/fix-pagination-issue

Relative posts should never fail to build, even if @dir or @name is nil