More relative path checks for the bash script's realpath processing

Specifically checks for base names of "." and ".." after symlink processing. This enables relative paths to be passed in that are terminated with such strings e.g. "/users/huntc/.." will correctly evaluate to "/users".

This issue relates to https://github.com/playframework/playframework/pull/1577