Fix broken core grains detection in localclient

A stacktrace was being thrown and swallowed in the core os detection
because there was no __file__ attribute when run via localclient.

Refs #13920