Avoid unnecessary metastore calls for internal databases

Fix for https://github.com/facebook/presto/issues/1557