Closes-Bug: #1403711
Issue: During storage upgrade, newline character is not removed
       causing osd restart failure
Fix: Removed newline character and check added to prevent
     osd restart failure

Change-Id: Ib0f7789e29e0adc7db620ea83c2edd749f849360
Tests: Verified storage upgrade from 1.20 to 2.0.18