Fix warnings: ignoring return value of ‘write’, declared with attribute warn_unused_result
Check parameter size before reading partition

This check is needed when trying to read a missing parameter partition,
for example after a lower format...
Clean whitespaces