CRM-15104 - applied the changes suggested by @colemanw.

----------------------------------------
* CRM-15104: Line item issues when creating a participant using the API
  https://issues.civicrm.org/jira/browse/CRM-15104