The influence of habitat boundaries on evolutionary branching along environmental gradients