don't create invalid objrefs for game object prototypes

Fixes trello#26.

This makes the API functions for retrieving prototypes of various game
object classes (apiFindItemPrototype, apiFindQuestPrototype,
apiGetJSFileObject) return prototype data correctly.