Fixes access to block/boundary names given material property

(closes #4420)
These two methods return an empty string if only an id is attached to the boundary/block. These ostringstream operations convert the id (*it) into a string, only if there is not a name found.