Replying to myself:

if an "untitled", empty document is created, then it has the mimetype "application/octet-stream"; if it doesn't have extension, it will be "text/plain", and only if it has the .circuit extension, then it will be recognized as a circuit.

So, as a workaround, in the test case a new, empty temporary file is created, with the .circuit extension, and that file is opened. This way a new document is obtained. Looks like a little hacking, but now it works :D

Creating new circuits in ktechlab could be implemented this way: when a new circuit should be created, open a new file in a temporary directory, and set a flag indicating that the current document isn't really saved. When the document is saved, write the file to its final location.