Adds BashCommands.waitForPortFree

@alasdairhodge could you review this please?