CRM-13876 - Fixed membership end date calculation should use start date,...

... not join date.

----------------------------------------
* CRM-13876:
  http://issues.civicrm.org/jira/browse/CRM-13876

This commit uses the code from https://github.com/CiviCRM42/civicrm42-core/pull/54.patch plus the additional conditional mentioned by Karin here: http://issues.civicrm.org/jira/browse/CRM-13786?focusedCommentId=54287&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-54287