Add the filename to some file loading error messages

- Helps to see what the problem is when upstream callers
  don't check errors.
- Add a check for an empty filename in
  MaterialManager::createTextureFromFile().